Skip to content

Commit

Permalink
fix(Listbox): focus was trigger on undefned
Browse files Browse the repository at this point in the history
  • Loading branch information
zernonia committed Aug 20, 2024
1 parent 7c2753c commit 3cea1ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/radix-vue/src/Listbox/ListboxRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ function getCollectionItem() {
return getItems().map(i => i.ref).filter(i => i.dataset.disabled !== '')
}
function onChangeHighlight(el: HTMLElement) {
function onChangeHighlight(el?: HTMLElement) {
if (!el)
return
highlightedElement.value = el
highlightedElement.value.focus()
highlightedElement.value.scrollIntoView({ block: 'nearest' })
Expand Down

0 comments on commit 3cea1ee

Please sign in to comment.