Skip to content

Commit

Permalink
fix(bubble-menu): add element to shouldShow in BubbleMenu opts (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpoulain authored Nov 4, 2024
1 parent c50eb4b commit 830e683
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/five-mice-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/extension-bubble-menu": patch
---

Add `element: HTMLElement` to `shouldShow` options within the BubbleMenu options.
2 changes: 2 additions & 0 deletions packages/extension-bubble-menu/src/bubble-menu-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface BubbleMenuPluginProps {
shouldShow?:
| ((props: {
editor: Editor
element: HTMLElement
view: EditorView
state: EditorState
oldState?: EditorState
Expand Down Expand Up @@ -238,6 +239,7 @@ export class BubbleMenuView {

const shouldShow = this.shouldShow?.({
editor: this.editor,
element: this.element,
view,
state,
oldState,
Expand Down

0 comments on commit 830e683

Please sign in to comment.