From 714f35d58254a1ac728bd480e2fb61ed60ea3bf6 Mon Sep 17 00:00:00 2001 From: atzzCokeK Date: Sun, 8 Sep 2024 01:14:08 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Dropdown=20=E3=81=A7=E3=83=A1=E3=83=8B?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E8=A1=A8=E7=A4=BA=E7=8A=B6=E6=85=8B=E3=81=A7?= =?UTF-8?q?=20Tab=20=E3=81=A7=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E5=A4=96?= =?UTF-8?q?=E3=81=AB=E9=81=B7=E7=A7=BB=E3=81=97=E3=81=9F=E3=82=891?= =?UTF-8?q?=E3=81=A4=E7=9B=AE=E3=81=AE=E3=82=A2=E3=82=A4=E3=83=86=E3=83=A0?= =?UTF-8?q?=E3=81=AB=E9=81=B7=E7=A7=BB=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/Dropdown/useKeyboardNavigation.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/smarthr-ui/src/components/Dropdown/useKeyboardNavigation.ts b/packages/smarthr-ui/src/components/Dropdown/useKeyboardNavigation.ts index 9f3dd7e263..786e1b4384 100644 --- a/packages/smarthr-ui/src/components/Dropdown/useKeyboardNavigation.ts +++ b/packages/smarthr-ui/src/components/Dropdown/useKeyboardNavigation.ts @@ -49,11 +49,8 @@ export function useKeyboardNavigation( trigger.focus() } else if (!e.shiftKey && e.target === lastTabbable) { // move focus next of the Trigger - const rootTriggers = tabbable(rootTriggerRef.current) - const rootTrigger = rootTriggers[rootTriggers.length - 1] - if (rootTrigger) { - rootTrigger.focus() - } + e.preventDefault() + firstTabbable.focus() // Dropdown内の最初の要素にフォーカスを移動 } } else if (e.key === 'Escape' || e.key === 'Esc') { if (triggerElementRef.current) {