]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Adding autocycling
authorlouismaxime.piton <louismaxime.piton@orange.com>
Mon, 26 Jun 2023 15:15:39 +0000 (17:15 +0200)
committerlouismaxime.piton <louismaxime.piton@orange.com>
Mon, 26 Jun 2023 15:15:39 +0000 (17:15 +0200)
js/src/dropdown.js

index af5fd16fc956a36481d5366b4c5b67d89c963eee..a630f38e773849c12e1f5b525931d2a79dbcf96c 100644 (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