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

Add ability to debounce of the toolbar show in the WidgetToolbarRepository due to Google Chrome selection quirks. #17690

Open
wants to merge 5 commits into
base: ck/epic/17230-linking-experience
Choose a base branch
from

Conversation

Mati365
Copy link
Member

@Mati365 Mati365 commented Dec 23, 2024

Suggested merge commit message (convention)

Fix (bookmark): Prevent bookmark popup flickering when clicking paragraphs with trailing bookmarks.


Additional information

When a widget (e.g., a bookmark anchor) is clicked, two consecutive update events may fire:

  1. First, when the widget gets focused (this is fine)
  2. Second, when the selection changes shortly after (beware, dragons live here)

While the widget usually stays selected, sometimes the selection may move to a different element (e.g., to the start of the parent paragraph). This can cause the toolbar to flicker as it's quickly shown and hidden.

This issue particularly affects widgets like anchors that contain a single SVG element. To prevent the flickering, we need to debounce the toolbar visibility updates.

Debounce is added as a flag because it does not apply to all HTML constructs, only selected ones.

Before

2024-12-23.10-11-39.mp4

After

after-fix-2024-12-23_16.41.38.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant