feat(hotkey): when text is selected, allow the default copy and paste behavior

This commit is contained in:
liujuping 2023-09-07 10:09:40 +08:00 committed by 林熠
parent 4507e83d7d
commit 4e0b2fae5d

View File

@ -277,6 +277,10 @@ export const builtinHotkey = (ctx: IPublicModelPluginContext) => {
if (isFormEvent(e) || !doc) {
return;
}
const anchorValue = document.getSelection()?.anchorNode?.nodeValue;
if (anchorValue && typeof anchorValue === 'string') {
return;
}
e.preventDefault();
let selected = doc.selection.getTopNodes(true);