8000 FloatingUI for LexicalMenu positioning by ivailop7 · Pull Request #7409 · facebook/lexical · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
< 8000 ul class="pagehead-actions flex-shrink-0 d-none d-md-inline" style="padding: 2px 0;">
  • Notifications You must be signed in to change notification settings
  • Fork 1.9k
  • FloatingUI for LexicalMenu positioning #7409

    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

    Draft
    wants to merge 8 commits into
    base: main
    Choose a base branch
    from

    Conversation

    ivailop7
    Copy link
    Collaborator
    @ivailop7 ivailop7 commented Mar 30, 2025

    Since the Core team agreed that it's OK for the @lexical/react package to depend on floating UI to fix the difficult problem of popovers positioning. This PR begins this transition. This PR does this for the typeahead-based menus.

    This PR also introduces a breaking change, because it removes the custom menuRenderFn prop in LexicalMenu so one does not need to pass it in each typeahead widget (Mention, Forward slash, Emoji Picker, AutoEmbed), but reuses the same style and configuration for all them. This ensures consistency and reduces the overall codebase size and removes a bit of the duplicated code with respect to the playground code.

    There are other places where FloatingUI can be used like 'floating format toolbar', 'add comment popover', 'context menu', 'drag handle positioning', 'table hover action buttons', 'dropdown (toolbar and table action items)', 'the new + icon menu' those can come later on.

    Copy link
    vercel bot commented Mar 30, 2025

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    lexical ❌ Failed (Inspect) May 4, 2025 11:01pm
    lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 4, 2025 11:01pm

    @ivailop7
    Copy link
    Collaborator Author
    ivailop7 commented Apr 1, 2025

    Currently has a bug with the Paste event from the custom context menu, where it appens to the start of the editor, vs where the selection was done. I guess it's a focus-related thing. Yet to pin down.

    @ivailop7
    Copy link
    Collaborator Author
    ivailop7 commented Apr 2, 2025

    I have found a much cleaner approach to do this. I'll do the ContextMenu by itself not using the LexicalMenu component at all. So this would allow to clean up the LexicalMenu and get rid of the pointer vs caret coordinates derivation code in the useMenuAnchor hook and make easier to reason about menu positioning.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. extended-tests Run extended e2e tests on a PR
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants
    0