fix(editor): prevent link mark from sticking to cursor
Override Link extension `inclusive: false` via `.extend()` to decouple it from `autolink: true`. Tiptap's source ties `inclusive` to `autolink`, causing typed text after a link to inherit the link mark. Also set `linkOnPaste: false` — autolink's PasteRule still auto-detects pasted URLs without the sticky cursor issue. Refs: ueberdosis/tiptap#2571, ueberdosis/tiptap#4249 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c7fda85a3e
commit
222f60d2dd
1 changed files with 2 additions and 1 deletions
|
|
@ -50,9 +50,10 @@ interface RichTextEditorRef {
|
|||
insertFile: (filename: string, url: string, isImage: boolean) => void;
|
||||
}
|
||||
|
||||
const LinkExtension = Link.configure({
|
||||
const LinkExtension = Link.extend({ inclusive: false }).configure({
|
||||
openOnClick: true,
|
||||
autolink: true,
|
||||
linkOnPaste: false,
|
||||
HTMLAttributes: {
|
||||
class: "text-primary hover:underline cursor-pointer",
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue