diff --git a/docs/api/marks/link.md b/docs/api/marks/link.md index ad05353a7..8f550351f 100644 --- a/docs/api/marks/link.md +++ b/docs/api/marks/link.md @@ -65,14 +65,6 @@ Link.configure({ }) ``` -If set to `'whenNotEditable'`, links will be opened on click only when editor is not editable. - -```js -Link.configure({ - openOnClick: 'whenNotEditable', -}) -``` - ### linkOnPaste Adds a link to the current selection if the pasted content only contains an url. diff --git a/packages/extension-link/src/helpers/clickHandler.ts b/packages/extension-link/src/helpers/clickHandler.ts index 321c1d7bc..b2c4ce5fb 100644 --- a/packages/extension-link/src/helpers/clickHandler.ts +++ b/packages/extension-link/src/helpers/clickHandler.ts @@ -3,8 +3,7 @@ import { MarkType } from '@tiptap/pm/model' import { Plugin, PluginKey } from '@tiptap/pm/state' type ClickHandlerOptions = { - type: MarkType, - whenNotEditable: boolean, + type: MarkType } export function clickHandler(options: ClickHandlerOptions): Plugin { @@ -12,9 +11,6 @@ export function clickHandler(options: ClickHandlerOptions): Plugin { key: new PluginKey('handleClickLink'), props: { handleClick: (view, pos, event) => { - if (options.whenNotEditable && view.editable) { - return false - } if (event.button !== 0) { return false } diff --git a/packages/extension-link/src/link.ts b/packages/extension-link/src/link.ts index bf5c80942..610173e28 100644 --- a/packages/extension-link/src/link.ts +++ b/packages/extension-link/src/link.ts @@ -48,7 +48,7 @@ export interface LinkOptions { * @example false * @example 'whenNotEditable' */ - openOnClick: boolean | 'whenNotEditable' + openOnClick: boolean /** * Adds a link to the current selection if the pasted content only contains an url. * @default true @@ -264,7 +264,6 @@ export const Link = Mark.create({ plugins.push( clickHandler({ type: this.type, - whenNotEditable: this.options.openOnClick === 'whenNotEditable', }), ) }