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: FloatingToolbar updatePopup loop and flickering within cursor range selection #3427

Closed
maxhelsel opened this issue Nov 25, 2022 · 2 comments

Comments

@maxhelsel
Copy link

Lexical version:
0.6.X, playground editor

Steps To Reproduce

  1. Rich text editor with FloatingTextFormatToolbarPlugin enabled
  2. Type a paragraph, hit enter/return twice, type another paragraph
  3. Use cursor to highlight bottom paragraph, drag to empty line and rest
  4. Seems to me that the cursor gets stuck between the FloatingToolbar and the editor body, causing update loops to the Toolbar updatePosition function
  • seems to also happen when highlighting and dragging to a line above that has text, if the toolbar position clips with the cursor

Link to code example:
https://playground.lexical.dev/
https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/FloatingTextFormatToolbarPlugin/index.tsx

Kapture 2022-11-25 at 11 03 43

The current behavior

flickering when holding mouse down and resting between paragraphs

The expected behavior

the toolbar should update position if there is text selected within anchor and the focus has 0 text length,
OR the toolbar should have "pointer-events: none" if user is currently holding down mouse button so updatePosition is not triggered

@trueadm
Copy link
Collaborator

trueadm commented Nov 25, 2022

Thanks for the detailed report. If you get a chance and would like to contribute a fix, then a PR would be really appreciated. :)

@thegreatercurve
Copy link
Contributor

This was fixed by the exceptional work of @LuciNyan in #4013!

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

No branches or pull requests

3 participants