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

[Bug]: ESC closes mentions dropdown, but items will still be selected and actions still forwarded to the menu #5662

Open
1 task done
Nantris opened this issue Sep 25, 2024 · 5 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@Nantris
Copy link
Contributor

Nantris commented Sep 25, 2024

Affected Packages

extension-suggestion

Version(s)

2.7.2

Bug Description

After pressing ESC the menu is still active, just hidden, since this PR enabled hiding it with ESC: #5544

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

ESC truly closes the menu. Enter and arrow keys should affect the editor, not a hidden menu.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@Nantris Nantris added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Sep 25, 2024
@github-project-automation github-project-automation bot moved this to Triage open in Tiptap Sep 25, 2024
@gethari
Copy link
Contributor

gethari commented Sep 30, 2024

If I understand correctly, after doing @ when user hit Esc we should ideally get rid of the inserted @ as well ? I guess that would solve this problem ?

@nperez0111
Copy link
Contributor

If I understand correctly, after doing @ when user hit Esc we should ideally get rid of the inserted @ as well ? I guess that would solve this problem ?

No, we do need to let the user to type an @ character. I think it just needs to destroy the menu until the next actual character. If the user goes next to the @ again and there is only white space to the right of it, it should reopen the menu.

I would take a PR to fix this, but honestly it is just very annoying behavior to implement and get right

@gethari
Copy link
Contributor

gethari commented Sep 30, 2024

@nperez0111 , I am able to overcome this issue by making the below changes, let me know if I can create a PR for this

Diff

image

Video

2024-09-30.at.15.03.26.-.Bronze.Puma.mp4

@rfgamaral
Copy link
Contributor

rfgamaral commented Sep 30, 2024

@gethari Not a maintainer, but so that you know, that is only a workaround for the Mention extension (one that doesn't really destroy the menu), it doesn't really fix the core issue. The core issue needs to be fixed in the Suggestion utility, most likely.

@gethari
Copy link
Contributor

gethari commented Sep 30, 2024

@rfgamaral yeah I understand, ideally the renderer?.onKeyDown?. should be stopped from executing that is based on the flags getting computed above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
No open projects
Status: Triage open
Development

No branches or pull requests

4 participants