Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/slimy-garlics-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Menu: Fix typeahead with leading visuals
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this say ActionMenu?

2 changes: 1 addition & 1 deletion src/hooks/useTypeaheadFocus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const useTypeaheadFocus = (open: boolean, providedRef?: React.RefObject<H

const focusNextMatch = () => {
const itemsStartingWithKey = focusableItems.filter(item => {
return item.textContent?.toLowerCase().startsWith(query)
return item.textContent?.toLowerCase().trim().startsWith(query)
})

const currentActiveIndex = itemsStartingWithKey.indexOf(activeElement)
Expand Down