Skip to content

Commit

Permalink
make selector ignore groups
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthkp committed Feb 12, 2024
1 parent 0c4c3f8 commit bcc4bcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react/src/drafts/SelectPanel2/SelectPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ const Panel: React.FC<SelectPanelProps> = ({

// used in SelectPanel.SearchInput
const moveFocusToList = () => {
const firstListElement = dialogRef.current?.querySelector('ul[role=listbox] li') as HTMLLIElement | undefined
const selector = 'ul[role=listbox] li:not([role=none])'
// being specific about roles because there can be another ul (tabs in header) and an ActionList.Group (li[role=none])
const firstListElement = dialogRef.current?.querySelector(selector) as HTMLLIElement | undefined
firstListElement?.focus()
}

Expand Down

0 comments on commit bcc4bcf

Please sign in to comment.