-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Bubble Menu flashes in Safari on click #3471
Comments
I can reproduce this issue, FWIW |
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 |
Can this fix added to the main repository? I got the same issue in Safari. |
Having the same issue. Can we re-open this? |
Why is this closed? I can still see the issue even in the Vue example in the documentation. |
In my case, I found that it only happens if we run a Tiptap command when clicking on a |
Indeed, removing these code lines with patch-package fixes the issue for me!
https://gist.github.com/phgn0/f236592a976fa13e35c91565bc5aab1e |
Any updates on this? |
I've actually discovered if you suppress the onMouseDown event from firing, it will stop the issue. I'm doing it on the direct child inside the BubbleMenu:
|
Seeing the same thing on Chrome on latest version, bug should be reopened |
looks like I still having this issue |
We are also affected by this bug. We are using button inside FloatingMenu to expand it. Blur event is immediately fired. |
Based on @phgn0's reply above, I was able to override the blur event when creating the BubbleMenu by passing in
For our use case, this prevents BubbleMenu from flashing in Safari and keeps everything working as expected in Chrome. |
I second @tsmith14's answer, it worked for me like a charm. Thank you for sharing this knowledge, super appreciated. |
Merged a PR related to this (see #5835). Look out for the next release, hopefully this issue will be fixed then. |
Released with 2.10.0 |
What’s the bug you are facing?
We're using the
BubbleMenu
React component. When clicking a button inside the bubble menu to toggle a mark (bold, italic, etc.), the Tippy instance is hidden and shown again, causing the menu to flash in Safari. (This doesn't appear to happen in Chrome.)Which browser was this experienced in? Are any special extensions installed?
Safari 16.1 on macOS 13.0.1. No special extensions.
How can we reproduce the bug on our side?
Screen.Recording.2022-11-28.at.4.34.07.PM.mov
Can you provide a CodeSandbox?
No response
What did you expect to happen?
I expect the bubble menu to stay visible, adjusting its position (if needed) based on the selection's mark update.
Anything to add? (optional)
Please bear with me; I'm a Ruby developer masquerading as a JavaScript developer. 😅
Forgive me if this issue exists somewhere; I could not find it. 🤞
I've been able to stop the bubble menu flashing by tweaking the Bubble Menu's
blurHandler
.The blur event runs when I click inside the bubble menu. Its
relatedElement
is the editor's HTML element. It doesn't match existing conditionals, so it callsthis.hide()
. If I return early when the related element is the editor, the menu doesn't flash. It appears to continue working as expected.Screen.Recording.2022-11-28.at.4.51.26.PM.mov
I can PR this change, but I am nervous I misunderstand something fundamental or will break core functionality. I'm glad to help in any way!
We just started building a text editor with Tiptap, and it's been a ton of fun. Thanks for all your help and hard work!
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: