Skip to content

Commit

Permalink
fix: ensure selected tab from overflow is correctly displayed
Browse files Browse the repository at this point in the history
Close #16
  • Loading branch information
javier-godoy authored and paodb committed Jul 8, 2024
1 parent a382994 commit 20c25de
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
// move the selected tab out of the overflow button
buttons = tabs._buttons;
const selectedIndex = buttons.findIndex(e=>e.item.component && e.item.component.querySelector('vaadin-tab[selected]'));
const overflowIndex = buttons.findIndex(e=>e.style.visibility);
if (selectedIndex>=overflowIndex && overflowIndex>0) {
buttons[0].parentElement.insertBefore(buttons[selectedIndex], buttons[overflowIndex-1]);
let overflowIndex = buttons.findIndex(e=>e.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 20c25de

Please sign in to comment.