Repository navigation
fix: postpone menu-bar initial render to prevent re-layout - #7312
Merged
Merged
Conversation
web-padawan
force-pushed
the
fix/menu-bar-prevent-relayout
branch
from
April 9, 2024 12:55
d669bd5 to
48d0e76
Compare
web-padawan
force-pushed
the
fix/menu-bar-prevent-relayout
branch
from
April 10, 2024 08:37
ae44093 to
b083d40
Compare
web-padawan
force-pushed
the
fix/menu-bar-prevent-relayout
branch
from
April 10, 2024 12:44
b083d40 to
91aee18
Compare
|
web-padawan
marked this pull request as ready for review
April 10, 2024 12:45
ugur-vaadin
approved these changes
Apr 10, 2024
vaadin-bot
pushed a commit
that referenced
this pull request
Apr 11, 2024
web-padawan
added a commit
that referenced
this pull request
Apr 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Related to #7271
Type of change
Note
This change will require a fix to
menuBarConnector.jsto make suremenubar._buttonsarray is ready:generateItems: tryCatchWrapper((nodeId) => { if (!menubar.shadowRoot) { // workaround for https://github.com/vaadin/flow/issues/5722 setTimeout(() => menubar.$connector.generateItems(nodeId)); return; } + if (!menubar._container) { + // Menu-bar defers first buttons render to avoid re-layout + // See https://github.com/vaadin/web-components/issues/7271 + queueMicrotask(() => menubar.$connector.generateItems(nodeId)); + return; + }