mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix(bubble-menu): prevent null pointer exception in BubbleMenu
(#5842)
This commit is contained in:
parent
2ea807d1db
commit
1959eb5920
5
.changeset/seven-hats-thank.md
Normal file
5
.changeset/seven-hats-thank.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/extension-bubble-menu": patch
|
||||
---
|
||||
|
||||
Fix a potential null pointer exception
|
@ -266,6 +266,7 @@ export class BubbleMenuView {
|
||||
if (isNodeSelection(state.selection)) {
|
||||
let node = view.nodeDOM(from) as HTMLElement
|
||||
|
||||
if (node) {
|
||||
const nodeViewWrapper = node.dataset.nodeViewWrapper ? node : node.querySelector('[data-node-view-wrapper]')
|
||||
|
||||
if (nodeViewWrapper) {
|
||||
@ -276,6 +277,7 @@ export class BubbleMenuView {
|
||||
return node.getBoundingClientRect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return posToDOMRect(view, from, to)
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user