Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't escape a created link #3293

Closed
1 of 2 tasks
Calvein opened this issue Oct 10, 2022 · 14 comments
Closed
1 of 2 tasks

Can't escape a created link #3293

Calvein opened this issue Oct 10, 2022 · 14 comments
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@Calvein
Copy link
Contributor

Calvein commented Oct 10, 2022

What’s the bug you are facing?

Here's a video with the issue:

Screen.Recording.2022-10-10.at.11.23.27.mov

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:

Screen.Recording.2022-10-10.at.11.29.14.mov

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?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@Calvein Calvein added the Type: Bug The issue or pullrequest is related to a bug label Oct 10, 2022
@Calvein
Copy link
Contributor Author

Calvein commented Oct 10, 2022

FYI, I fixed this by installing the v30 since the issue since to be from the v31

@Pats666
Copy link

Pats666 commented Oct 12, 2022

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!

@lordinkavu
Copy link

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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

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

@github-actions github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Feb 1, 2023
@cnicodeme
Copy link

I confirm I have the same issue. Commenting to remove the "stale" tag

@github-actions github-actions bot removed the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label Feb 2, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2023

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

@github-actions github-actions bot added the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label May 6, 2023
@chrisdeeming
Copy link

Commenting again to remove "stale" tag.

@chrisdeeming
Copy link

I assumed the solution to this would be to use exitable but this doesn't appear to do anything.

@github-actions github-actions bot removed the Info: Stale The issue or pullrequest has not been updated in a while and might be stale label May 9, 2023
@bdbch bdbch added this to Tiptap Aug 4, 2023
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Aug 4, 2023
@DannyFeliz
Copy link
Contributor

This still an issue

@hugh-sun-everlaw
Copy link

hugh-sun-everlaw commented Aug 8, 2023

Overwriting the "inclusive" attribute of the Link extension to be false, like the following,

Link.extend({
    inclusive: false
})

, worked for me.

@romansp
Copy link
Contributor

romansp commented Oct 17, 2023

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 #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
})

@mechiland
Copy link

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.

@loki4514
Copy link

loki4514 commented Mar 25, 2024

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

Screenshot (336)

@nperez0111
Copy link

Should be resolved in the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Status: Triage open
Development

No branches or pull requests