Skip to content

Commit

Permalink
fix: fix global hotkey triggering on content editable elements (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccloli authored Jun 6, 2024
1 parent 239c0b0 commit a2cc418
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/designer/src/dnd/use-dnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ export function useDnd({
};

const onKeyDown = (e: React.KeyboardEvent) => {
const isInputElement = isInputElements((e.target as HTMLElement).nodeName);
const target = e.target as HTMLElement;
const isInputElement = target.isContentEditable || isInputElements(target.nodeName);
// 禁用输入事件的触发的快捷键逻辑
if (!isInputElement) {
const key = getHotkey(e);
Expand Down

0 comments on commit a2cc418

Please sign in to comment.