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 committed Sep 7, 2023
1 parent 7ef6230 commit c2d5c88
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 c2d5c88

Please sign in to comment.