Skip to content

Commit cdc5d94

Browse files
committed
fix: fix off-by-one error in overflow handling
1 parent 20c25de commit cdc5d94

File tree

1 file changed

+1
-1
lines changed
  • src/main/resources/META-INF/frontend/fcEnhancedTabs

1 file changed

+1
-1
lines changed

src/main/resources/META-INF/frontend/fcEnhancedTabs/connector.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
buttons = tabs._buttons;
6666
const selectedIndex = buttons.findIndex(e=>e.item.component && e.item.component.querySelector('vaadin-tab[selected]'));
6767
let overflowIndex = buttons.findIndex(e=>e.style.visibility);
68-
while (selectedIndex>=overflowIndex && overflowIndex>0 && buttons[selectedIndex].style.visibility) {
68+
while (selectedIndex>=overflowIndex && overflowIndex>=0 && buttons[selectedIndex].style.visibility) {
6969
buttons[0].parentElement.insertBefore(buttons[selectedIndex], buttons[overflowIndex--]);
7070
__detectOverflow();
7171
buttons[selectedIndex]._position = selectedIndex;

0 commit comments

Comments
 (0)