Skip to content

Commit

Permalink
fix: fix off-by-one error in overflow handling
Browse files Browse the repository at this point in the history
  • Loading branch information
javier-godoy authored and paodb committed Jul 15, 2024
1 parent 20c25de commit 05094c8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
buttons = tabs._buttons;
const selectedIndex = buttons.findIndex(e=>e.item.component && e.item.component.querySelector('vaadin-tab[selected]'));
let overflowIndex = buttons.findIndex(e=>e.style.visibility);
while (selectedIndex>=overflowIndex && overflowIndex>0 && buttons[selectedIndex].style.visibility) {
while (selectedIndex>=overflowIndex && overflowIndex>=0 && buttons[selectedIndex].style.visibility) {
buttons[0].parentElement.insertBefore(buttons[selectedIndex], buttons[overflowIndex--]);
__detectOverflow();
buttons[selectedIndex]._position = selectedIndex;
Expand Down

0 comments on commit 05094c8

Please sign in to comment.