Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Dropdown でメニュー表示時に最後のアイテムで Tab を押したら、 Trigger の次のアイテムに focus する #4898

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down