{
const itemWidth = itemsSizes[i].width;
-
- // If the item dont fit in the available space or if we have already
- // overflowed items, we hide it. This means that once one item overflows,
- // all the following items will be hidden.
+ const item = list.children[i];
if (itemWidth >= availableWidth || overflowItemsIdx.length > 0) {
overflowItemsIdx.push(i);
item.style.visibility = 'hidden';
@@ -174,7 +183,7 @@
maxHeight = itemHeight;
}
}
- }
+ });
// check if overflowed items would fit if the moreButton were not visible
const overflowedWidth = overflowItemsIdx.reduce(
@@ -201,6 +210,7 @@
list.style.maxWidth = `${maxWidth}px`;
list.style.maxHeight = `${maxHeight}px`;
},
+
/**
* Fixes the visibility of the dividers that are shown and hidden when the list overflows.
* The visible list should not end with a divider, and the overflowed items should not
@@ -254,17 +264,17 @@
+