Skip to content

Commit 82f0267

Browse files
authoredAug 2, 2024··
[Alpha][SelectPanel] Ensure focus is set on SelectPanel item when arrowing down from input (#2987)
1 parent 4d8ec0c commit 82f0267

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎.changeset/fast-items-tell.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/view-components': patch
3+
---
4+
5+
Ensure focus is set on SelectPanel item when arrowing down from input

‎app/components/primer/alpha/select_panel_element.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -633,10 +633,10 @@ export class SelectPanelElement extends HTMLElement {
633633
this.#handleItemActivated(item, false)
634634
}
635635
} else if (key === 'ArrowDown') {
636-
const item = (this.focusableItem || this.visibleItems[0]) as HTMLLIElement
636+
const item = (this.focusableItem || this.#getItemContent(this.visibleItems[0])) as HTMLLIElement
637637

638638
if (item) {
639-
this.#getItemContent(item)!.focus()
639+
item.focus()
640640
event.preventDefault()
641641
}
642642
} else if (key === 'Home') {

0 commit comments

Comments
 (0)
Please sign in to comment.