fix(multi-select): avoid runtime error if items is empty

This commit is contained in:
Eric Liu 2022-12-07 20:31:58 -08:00
commit d72999b4cb

View file

@ -203,6 +203,7 @@
function change(direction) {
let index = highlightedIndex + direction;
const length = filterable ? filteredItems.length : items.length;
if (length === 0) return;
if (index < 0) {
index = length - 1;
} else if (index >= length) {