Skip to content

Commit

Permalink
fix(rich-text-link): Change openOnClick default to whenNotEditable (
Browse files Browse the repository at this point in the history
#744)

feat(rich-text-link): Change `openOnClick` default to `whenNotEditable`
  • Loading branch information
rfgamaral authored Apr 15, 2024
1 parent 6ffafa6 commit db729d4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/extensions/rich-text/rich-text-link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ function linkPasteRule(config: Parameters<typeof markPasteRule>[0]) {
*/
const RichTextLink = Link.extend({
inclusive: false,
addOptions() {
return {
...this.parent?.(),
openOnClick: 'whenNotEditable' as LinkOptions['openOnClick'],
}
},
addAttributes() {
return {
...this.parent?.(),
Expand Down
3 changes: 0 additions & 3 deletions stories/typist-editor/constants/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ const DEFAULT_RICH_TEXT_KIT_OPTIONS: Partial<RichTextKitOptions> = {
dropCursor: {
class: 'ProseMirror-dropcursor',
},
link: {
openOnClick: false,
},
orderedList: {
smartToggle: true,
},
Expand Down

0 comments on commit db729d4

Please sign in to comment.