Adding autocycling

This commit is contained in:
louismaxime.piton 2023-06-26 17:15:39 +02:00
parent 787dfea8a2
commit 4fa3c39cfa

View File

@ -331,9 +331,8 @@ class Dropdown extends BaseComponent {
return
}
// if target isn't included in items (e.g. when expanding the dropdown)
// allow cycling to get the last item in case key equals ARROW_UP_KEY
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()
// Allow cycling with up and down arrows
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, true).focus()
}
// Static