tiptap
tiptap copied to clipboard
Can't escape a created link
What’s the bug you are facing?
Here's a video with the issue:
As you can see, we can't "get out" of the link once it's set.
Which browser was this experienced in? Are any special extensions installed?
Only tested in Chrome 105
How can we reproduce the bug on our side?
On the example page, can have 3 ways to add links:
- Select text & paste a link
- Select text & click on setLink
- Paste a link
We don't have the issue when you paste a link directly when we do for the 2 others cases, see:
Can you provide a CodeSandbox?
No response
What did you expect to happen?
I would expect the link to not be active after setting it.
Anything to add? (optional)
No response
Did you update your dependencies?
- [X] Yes, I’ve updated my dependencies to use the latest version of all packages.
Are you sponsoring us?
- [ ] Yes, I’m a sponsor. 💖
FYI, I fixed this by installing the v30 since the issue since to be from the v31
FYI, I fixed this by installing the v30 since the issue since to be from the v31
Thanks for the tips! I encounter the same bug, and your solution works!
Facing the same issue w/ latest v2.0.0-beta.199. I was able to temporarily solve it by running editor.commands.unsetMark('link');
when the user clicks on link button and no text is selected.
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days
I confirm I have the same issue. Commenting to remove the "stale" tag
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days
Commenting again to remove "stale" tag.
I assumed the solution to this would be to use exitable
but this doesn't appear to do anything.
This still an issue
Overwriting the "inclusive" attribute of the Link extension to be false, like the following,
Link.extend({
inclusive: false
})
, worked for me.
This actually should be controlled with exitable
and inclusive
properties. exitable: true
allows to "escape" link mark with ArrowRight
key. inclusive: false
makes mark inactive when cursor is at its end so typing "escapes" mark.
Unfortunately due to a bug in extension config overrides value of the exitable
property wasn't preserved properly. This appears to be fixed by https://github.com/ueberdosis/tiptap/pull/4191 that's included in 2.2.0-rc.4
.
By default @tiptap/extension-link
isn't exitable so you'd need to extend it.
Link.extend({
exitable: true
})
I can verify that @romansp's solution works. Instead of having editable: true
, simply put inclusive: false
works.
Link.extend({
inclusive: false
})
And you don't have to upgrade to 2.2.0-rc.4
. 2.1.12
works too.
Ok this
Link.extend({ inclusive: false })
this is working but there is error " hello how are you " (" ") is being interpreted between the text. when I inspect the <P> </P>