mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-24 03:39:01 +08:00
Use parent window for cross-frame instantiation (#5534)
* Add cross-iframe JS support to mention extension * added changeset --------- Co-authored-by: Taylor Ermolov <taylor@nermolov.com>
This commit is contained in:
parent
07fa49d026
commit
da8fcf373e
5
.changeset/khaki-tips-judge.md
Normal file
5
.changeset/khaki-tips-judge.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/extension-mention": patch
|
||||
---
|
||||
|
||||
Add support for cross-window institation with mentions
|
@ -119,7 +119,8 @@ export const Mention = Node.create<MentionOptions>({
|
||||
])
|
||||
.run()
|
||||
|
||||
window.getSelection()?.collapseToEnd()
|
||||
// get reference to `window` object from editor element, to support cross-frame JS usage
|
||||
editor.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd()
|
||||
},
|
||||
allow: ({ state, range }) => {
|
||||
const $from = state.doc.resolve(range.from)
|
||||
|
Loading…
Reference in New Issue
Block a user