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: Context Menu sometimes is not aligned and moves when the content is scrolled #6699

Open
wenbert opened this issue Oct 4, 2024 · 3 comments

Comments

@wenbert
Copy link

wenbert commented Oct 4, 2024

Lexical version: 0.18.0

Steps To Reproduce

  1. In the Playground, make the content longer than the current screen height.
  2. Turn on the Use Lexical Context Menu from the Settings
  3. Highlight something and then Right Click to show the Context Menu.
  4. Scroll.
  5. Highlight something else again and then Right Click. The Context Menu is now in a different location.
  6. (optional) With the context menu showing, scroll the page.

The current behavior

The Context Menu gets mis-aligned. It could be a couple lines down the current highlighted text.
It also gets moved around when the user scrolls the page.
screenshot_2024-10-04 23-30-11

The expected behavior

The Context Menu should be next to the highlighted content.
It should stick and not move when the user scrolls the page.

@moy2010
Copy link
Contributor

moy2010 commented Oct 4, 2024

The code from the playground is not expected to be production-ready, and is not part of the Lexical library. It's only provided as examples for some functionality.

That being said, this does not qualify as a bug, but you are welcome to contribute with a PR for fixing the aforementioned behaviour, so that other users using the playground code can benefit from it.

@etrepum
Copy link
Collaborator

etrepum commented Oct 4, 2024

I would say that the menu positioning is a bug, that we've been trying to fix but it's been tricky because Meta has (had?) some dependencies on the confusing/broken legacy behavior. Any improvements here would be appreciated. See also #6558, #6566, #6510, etc.

@ivailop7
Copy link
Collaborator

ivailop7 commented Oct 5, 2024

I think maybe it's worth doing a clean slate context menu based on 'floating-ui.com', rather than try to fix this one for n-th time. For anyone interested, that would be my suggestion.

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

4 participants