Skip to content

Commit

Permalink
feat(hotkey): when text is selected, allow the default copy and paste…
Browse files Browse the repository at this point in the history
… behavior
  • Loading branch information
liujuping authored and JackLian committed Sep 7, 2023
1 parent 4507e83 commit 4e0b2fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/engine/src/inner-plugins/builtin-hotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4e0b2fa

Please sign in to comment.