question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Suggestion menu appears when clicking on potential mention

See original GitHub issue

What’s the bug you are facing?

Clicking an incomplete mention causes the suggestion menu to appear.

How can we reproduce the bug on our side?

  1. Go to the mention example on the tiptap website: https://tiptap.dev/examples/suggestions
  2. Type @win and then esc. Do not complete the extention.
  3. Type something else after
  4. Click on @win (may need to click twice)
  5. Mention menu will appear

https://user-images.githubusercontent.com/9100467/161542187-153c6d08-ee8f-4364-abc4-d808a1cb268a.mp4

Can you provide a CodeSandbox?

No response

What did you expect to happen?

After a user indicates they do not want to mention (e.g. they hit esc) the mention should act as plain text.

Anything to add? (optional)

This is particularly confusing because it happens when the editor is not in editable mode.

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. 💖

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
scottsidwellcommented, Apr 8, 2022

I had some time to look into this today (separate to the maintainers) and have some comments to add.

Firstly, you’ve actually mentioned two bugs, the second one being that: “suggestions should not be triggered when editor.isEditable === false. Since this was fairly straightforward, I raised a fix for this in https://github.com/ueberdosis/tiptap/pull/2692.

Back to the main issue you’ve raised here, the root cause appears to be an underlying design decision of how the suggestions plugin works. My understanding of how it works, is that (when you have an empty selection) it looks backwards in the current text block to see if the text that precedes your cursor matches the rough semantics of ${char}.*. Since this is reactive, i.e. it waits for change in the editor state, and then tries to decide whether to display the suggestion UI, there’s no mechanism for it to not show the suggestion UI when you select that text again in the future.

I’ll let the maintainers weigh in here on how they see suggestions evolving, since any change to this behaviour will likely have flow on impacts to other parts of the UX here. e.g. this would cease to work

https://user-images.githubusercontent.com/38820281/162371171-3858950b-65d0-4137-8df2-54b28d426074.mov

0reactions
stale[bot]commented, Jul 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Right-click context menu keeps popping up in Windows 11/10
According to them, the right-click context menu keeps popping up randomly without pressing the mouse right-click on their Windows PC.
Read more >
Use @mention in comments to tag someone for feedback
Assign tasks using @mentions · In the top of the comment, hover over the circle next to Assigned to you. A check mark...
Read more >
Building a Custom Right-Click (Context) Menu with JavaScript
Nick Salloum mimics Dropbox and Gmail, building a functioning custom context menu (right-click menu) from scratch with JavaScript.
Read more >
<input>: The Input (Form Input) element - HTML
The <input> HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide...
Read more >
New features available with macOS Ventura. - Apple
Edit strong passwords suggested by Safari to adjust for site‑specific ... When AirPods are connected, an AirPods menu will appear at the top...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found