From 4fa3c39cfa552414510b85059b4f3031296edb83 Mon Sep 17 00:00:00 2001 From: "louismaxime.piton" Date: Mon, 26 Jun 2023 17:15:39 +0200 Subject: [PATCH] Adding autocycling --- js/src/dropdown.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/src/dropdown.js b/js/src/dropdown.js index af5fd16fc9..a630f38e77 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -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