fix: Tab selects highlighted dropdown option before advancing focus

When the dropdown is open with a highlighted option, pressing Tab now
selects that option and then moves focus to the next field naturally.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-02-18 18:58:42 -05:00
parent d2b5a8017e
commit 6ec00b6723

View File

@@ -78,9 +78,8 @@ export function FeedbackPage() {
triggerRef.current?.focus()
break
case 'Tab':
if (typeDropdownOpen) {
setTypeDropdownOpen(false)
setHighlightedIndex(-1)
if (typeDropdownOpen && highlightedIndex >= 0) {
handleSelectType(FEEDBACK_TYPES[highlightedIndex].value)
}
break
}