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

fix(NcRichContenteditable): capture and stop Esc keydown event when closing tribute #5353

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Mar 6, 2024

☑️ Resolves

🖼️ Screenshots

Tested against Talk (we handle Esc keyup depending whether tribute state is open or not

Before (event isn't emitted -> blur input)

Screencast.from.06.03.2024.12.57.48.webm

After (Esc doesn't blur the input)

Screencast.from.06.03.2024.12.53.54.webm

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 3️⃣ Backport to next requested with a Vue 3 upgrade

@Antreesy Antreesy added bug Something isn't working 3. to review Waiting for reviews feature: rich-contenteditable Related to the rich-contenteditable components labels Mar 6, 2024
@Antreesy Antreesy added this to the 8.8.2 milestone Mar 6, 2024
@Antreesy Antreesy requested a review from ShGKme March 6, 2024 11:59
@Antreesy Antreesy self-assigned this Mar 6, 2024
@juliushaertl juliushaertl modified the milestones: 8.8.2, 8.9.1 Mar 6, 2024
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd not add tribute-related things to the component interface. If we want to add the interface to handle autocomplete state, it could be something like autocomplite-toggle, so we don't rely on what library we use internally.

And though it fixes the issue in Talk, it doesn't fix the initial issue.

These events were needed only to handle Escape from NcRichContenteditable itself ignoring it from autocomplete. A better alternative is to not trigger keydown for Escape from open autocomplite. Then it works in Talk without the manual handling the autocomplite state.

@Antreesy
Copy link
Contributor Author

Antreesy commented Mar 6, 2024

A better alternative is to not trigger keydown for Escape from open autocomplite. Then it works in Talk without the manual handling the autocomplite state.

Seems to work with 'capturing' a keydown event and check tribute state, then close it manually

…hen tribute is open

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
@Antreesy Antreesy force-pushed the fix/5352/tribute-on-close-focus branch from 0a760ea to 4762758 Compare March 6, 2024 14:03
@Antreesy Antreesy requested a review from ShGKme March 6, 2024 14:42
@Pytal Pytal modified the milestones: 8.9.1, 8.9.2 Mar 6, 2024
@Antreesy Antreesy changed the title fix(NcRichContenteditable): emit tribute-active-* events from the component fix(NcRichContenteditable): capture and stop Esc keydown event when closing tribute Mar 6, 2024
@nickvergessen nickvergessen merged commit 724e7fa into master Mar 7, 2024
18 checks passed
@nickvergessen nickvergessen deleted the fix/5352/tribute-on-close-focus branch March 7, 2024 16:06
@ShGKme
Copy link
Contributor

ShGKme commented Mar 8, 2024

/backport to next

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working feature: rich-contenteditable Related to the rich-contenteditable components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[NcRichContenteditable] Pressing ESC not only closes the link picker but also unfocuses the input
5 participants