Skip to content

Commit

Permalink
Update focus_group.ts (#2924)
Browse files Browse the repository at this point in the history
  • Loading branch information
kendallgassner authored Jun 27, 2024
1 parent 3ccc8d9 commit 235544d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tough-otters-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/view-components': patch
---

Add a valid selector to focus-group
2 changes: 1 addition & 1 deletion app/components/primer/focus_group.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@oddbird/popover-polyfill'

const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]']
const validSelectors = ['[role="menuitem"]', '[role="menuitemcheckbox"]', '[role="menuitemradio"]', '[role="option"]']
const menuItemSelector = validSelectors.map(selector => `:not([hidden]) > ${selector}`).join(', ')

const getMnemonicFor = (item: Element) => item.textContent?.trim()[0].toLowerCase()
Expand Down

0 comments on commit 235544d

Please sign in to comment.