From dcbb300ad8b27787001b600d1323f3fe66f86b40 Mon Sep 17 00:00:00 2001 From: zhouyun1 Date: Fri, 13 Oct 2023 10:52:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(tree):=20#2622=20=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=A1=86onKeyDown=E4=BA=8B=E4=BB=B6=E5=A2=9E=E5=8A=A0=E9=98=BB?= =?UTF-8?q?=E6=AD=A2=E5=86=92=E6=B3=A1=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/clean-jars-shop.md | 5 +++++ .changeset/stale-impalas-hunt.md | 5 +++++ packages/ui/tree/src/use-tree-action.tsx | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/clean-jars-shop.md create mode 100644 .changeset/stale-impalas-hunt.md diff --git a/.changeset/clean-jars-shop.md b/.changeset/clean-jars-shop.md new file mode 100644 index 000000000..d849ba147 --- /dev/null +++ b/.changeset/clean-jars-shop.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +Tree fix: 修复编辑状态下键盘无法移动光标问题 diff --git a/.changeset/stale-impalas-hunt.md b/.changeset/stale-impalas-hunt.md new file mode 100644 index 000000000..40168499b --- /dev/null +++ b/.changeset/stale-impalas-hunt.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/tree": patch +--- + +fix: 修复编辑状态下键盘无法移动光标问题 diff --git a/packages/ui/tree/src/use-tree-action.tsx b/packages/ui/tree/src/use-tree-action.tsx index 65d01409f..f9729a409 100644 --- a/packages/ui/tree/src/use-tree-action.tsx +++ b/packages/ui/tree/src/use-tree-action.tsx @@ -404,9 +404,10 @@ const EditableNodeInput = (props: EditableNodeInputProps) => { } const onKeydown = (evt: React.KeyboardEvent) => { + evt.stopPropagation() + if (evt.keyCode === 13) { evt.preventDefault() - evt.stopPropagation() saveEdit() }