-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Enhance bubble menu positioning for table cell selections #6482
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
Conversation
🦋 Changeset detectedLatest commit: 4b20c30 The changes in this PR will be included in the next version bump. This PR includes changesets to release 71 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the bubble menu’s positioning logic for table cell selections in the editor. Key changes include introducing a new utility function to combine DOM rectangles, updating position calculations for cell selections in the BubbleMenuView, and a changeset file for versioning.
- Added combineDOMRects utility function to merge two DOMRect instances
- Updated updatePosition method in BubbleMenuView to account for multi-cell selections
- Created a changeset documenting the fix
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/extension-bubble-menu/src/bubble-menu-plugin.ts | Introduced combineDOMRects and updated position logic |
.changeset/early-guests-melt.md | Added changeset for bubble menu positioning fix |
Co-authored-by: Copilot <[email protected]>
…com:ueberdosis/tiptap into bdbch/6410-table-cell-bubblemenu-adjustment
Changes Overview
This pull request enhances the
BubbleMenuPlugin
inpackages/extension-bubble-menu
by improving the handling of cell selections in the editor. It introduces a utility function to combine DOM rectangles and updates the logic for positioning the bubble menu when a cell selection is detected.Improvements to cell selection handling:
Added
combineDOMRects
utility function: This function calculates a bounding rectangle that encompasses two DOM rectangles, ensuring proper handling of multi-cell selections. (packages/extension-bubble-menu/src/bubble-menu-plugin.ts
, packages/extension-bubble-menu/src/bubble-menu-plugin.tsR15-R44)Updated
updatePosition
method inBubbleMenuView
: Enhanced the logic to detect cell selections and compute the correct bounding rectangle for the bubble menu. This ensures that the menu is positioned correctly for both single-cell and multi-cell selections. (packages/extension-bubble-menu/src/bubble-menu-plugin.ts
, packages/extension-bubble-menu/src/bubble-menu-plugin.tsL294-R349)Checklist
Related Issues
Fixes #6410