From c5967f52a628c7c260c109ca2570b5105e08f5a4 Mon Sep 17 00:00:00 2001 From: ayang <473033518@qq.com> Date: Sat, 5 Oct 2024 20:28:53 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E6=8C=89=E4=B8=8B=20?= =?UTF-8?q?`home`=20=E9=94=AE=E5=9B=9E=E5=88=B0=E9=A1=B6=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Clipboard/Panel/components/List/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Clipboard/Panel/components/List/index.tsx b/src/pages/Clipboard/Panel/components/List/index.tsx index dba0126c..a0add3f8 100644 --- a/src/pages/Clipboard/Panel/components/List/index.tsx +++ b/src/pages/Clipboard/Panel/components/List/index.tsx @@ -52,7 +52,7 @@ const List = () => { }, [state.list.length]); useOSKeyPress( - ["space", "enter", "backspace", "uparrow", "downarrow"], + ["space", "enter", "backspace", "uparrow", "downarrow", "home"], (_, key) => { state.eventBusId = state.activeId; @@ -72,6 +72,9 @@ const List = () => { // 选中下一个 case "downarrow": return state.$eventBus?.emit(LISTEN_KEY.CLIPBOARD_ITEM_SELECT_NEXT); + // 回到顶部 + case "home": + return rowVirtualizer.scrollToIndex?.(0); } }, {