-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Bdbch/6446 cleanup bubble menu resize #6496
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: 99c12d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 69 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 fixes a bug in the BubbleMenu plugin where the resize handler was not unregistered on destroy, and refactors the resize event handling for better readability and maintainability.
- Extracts the inline resize logic into a dedicated method (resizeHandler) for clarity.
- Updates the destroy method to properly remove the resize event listener.
- Adds changeset updates for various tiptap packages to address the bug.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
packages/extension-bubble-menu/src/bubble-menu-plugin.ts | Refactored resize handler extraction and event cleanup. |
.changeset/great-terms-jam.md | Updated changeset for tiptap package patches. |
Comments suppressed due to low confidence (1)
packages/extension-bubble-menu/src/bubble-menu-plugin.ts:274
- [nitpick] Consider adding a brief comment above the resizeHandler method explaining that it debounces the call to updatePosition to enhance code clarity and maintainability.
resizeHandler = () => {
@tiptap/core
@tiptap/extension-blockquote
@tiptap/extension-bold
@tiptap/extension-bubble-menu
@tiptap/extension-bullet-list
@tiptap/extension-code
@tiptap/extension-code-block
@tiptap/extension-code-block-lowlight
@tiptap/extension-collaboration
@tiptap/extension-collaboration-caret
@tiptap/extension-color
@tiptap/extension-details
@tiptap/extension-document
@tiptap/extension-drag-handle
@tiptap/extension-drag-handle-react
@tiptap/extension-drag-handle-vue-2
@tiptap/extension-drag-handle-vue-3
@tiptap/extension-emoji
@tiptap/extension-file-handler
@tiptap/extension-floating-menu
@tiptap/extension-font-family
@tiptap/extension-hard-break
@tiptap/extension-heading
@tiptap/extension-highlight
@tiptap/extension-horizontal-rule
@tiptap/extension-image
@tiptap/extension-invisible-characters
@tiptap/extension-italic
@tiptap/extension-link
@tiptap/extension-list
@tiptap/extension-mathematics
@tiptap/extension-mention
@tiptap/extension-node-range
@tiptap/extension-ordered-list
@tiptap/extension-paragraph
@tiptap/extension-strike
@tiptap/extension-subscript
@tiptap/extension-superscript
@tiptap/extension-table
@tiptap/extension-table-of-contents
@tiptap/extension-text
@tiptap/extension-text-align
@tiptap/extension-text-style
@tiptap/extension-typography
@tiptap/extension-underline
@tiptap/extension-unique-id
@tiptap/extension-youtube
@tiptap/extensions
@tiptap/html
@tiptap/pm
@tiptap/react
@tiptap/starter-kit
@tiptap/static-renderer
@tiptap/suggestion
@tiptap/vue-2
@tiptap/vue-3
@tiptap/extension-character-count
@tiptap/extension-dropcursor
@tiptap/extension-focus
@tiptap/extension-gapcursor
@tiptap/extension-history
@tiptap/extension-list-item
@tiptap/extension-list-keymap
@tiptap/extension-placeholder
@tiptap/extension-table-cell
@tiptap/extension-table-header
@tiptap/extension-table-row
@tiptap/extension-task-item
@tiptap/extension-task-list
commit: |
Changes Overview
This pull request addresses a bug in the BubbleMenu plugin where the global resize handler was not properly unregistered upon destruction. The changes include refactoring the resize handler to improve maintainability and ensure proper cleanup.
Bug Fixes:
.changeset/great-terms-jam.md
: Added patch updates for@tiptap/extension-bubble-menu
,@tiptap/react
,@tiptap/vue-2
, and@tiptap/vue-3
to fix the issue with the BubbleMenu plugin's resize handler not being unregistered on destroy.Code Refactoring:
packages/extension-bubble-menu/src/bubble-menu-plugin.ts
: Refactored the resize handler by extracting it into a dedicated method (resizeHandler
) to improve readability and maintainability.packages/extension-bubble-menu/src/bubble-menu-plugin.ts
: Updated thedestroy
method to ensure the resize handler is properly removed from thewindow
event listeners.packages/extension-bubble-menu/src/bubble-menu-plugin.ts
: Replaced the inline resize logic in the constructor with the newresizeHandler
method for consistency.Checklist
Related Issues