1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-17 19:06:40 +02:00

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 return
} }
// if target isn't included in items (e.g. when expanding the dropdown) // Allow cycling with up and down arrows
// allow cycling to get the last item in case key equals ARROW_UP_KEY getNextActiveElement(items, target, key === ARROW_DOWN_KEY, true).focus()
getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()
} }
// Static // Static