fix: close context menu when typing

This commit is contained in:
nivedin
2024-01-04 15:41:10 +05:30
committed by Andrew Bastin
parent 7406a241e6
commit 51ebc198de

View File

@@ -410,7 +410,6 @@ const initView = (el: any) => {
class {
update(update: ViewUpdate) {
if (props.readonly) return
if (update.docChanged) {
const prevValue = clone(cachedValue.value)
@@ -441,6 +440,17 @@ const initView = (el: any) => {
clipboardEv = null
pastedValue = null
}
if (props.contextMenuEnabled) {
// close the context menu if text is being updated in the editor
invokeAction("contextmenu.open", {
position: {
top: 0,
left: 0,
},
text: null,
})
}
}
}
}