File tree Expand file tree Collapse file tree 14 files changed +236
-40
lines changed
vaadin-lumo-styles/src/components Expand file tree Collapse file tree 14 files changed +236
-40
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { css } from 'lit';
88export const menuBarStyles = css `
99 : host {
1010 dis play: block;
11+ min- width: 0;
1112 }
1213
1314 : host ([hidden ]) {
Original file line number Diff line number Diff line change @@ -471,6 +471,13 @@ export const MenuBarMixin = (superClass) =>
471471 __setOverflowItems ( buttons , overflow ) {
472472 const container = this . _container ;
473473
474+ // Prevent the container from shrinking while buttons are being hidden.
475+ // The host has min-width: 0 so it can shrink inside flex/grid layouts.
476+ // Without this lock, hiding a button reduces the host width, which
477+ // shrinks the container (width: 100%), shifting all button positions
478+ // and causing a cascading collapse where every button appears to overflow.
479+ container . style . minWidth = `${ container . offsetWidth } px` ;
480+
474481 if ( container . offsetWidth < container . scrollWidth ) {
475482 this . _hasOverflow = true ;
476483
@@ -501,6 +508,8 @@ export const MenuBarMixin = (superClass) =>
501508 const items = buttons . filter ( ( b ) => ! remaining . includes ( b ) ) . map ( ( b ) => b . item ) ;
502509 this . __updateOverflow ( items ) ;
503510 }
511+
512+ container . style . minWidth = '' ;
504513 }
505514
506515 /** @private */
You can’t perform that action at this time.
0 commit comments