-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: wait for updateComplete before setting positionTarget #7524
Conversation
I can see that the initial blink in the bottom right corner is gone, however, there's still one minor issue when a sub-menu is opened after another one closes: menu-bar-blink.mp4As seen in the recording, it briefly opens in its last position and then it moves to the right one. |
Right, thanks. I think that's what I originally attempted to prevent when converting to Lit. Will investigate it further. |
@DiegoCardoso updated to use a different approach, now the flickering seems to be gone. Could you please check it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see any flashing now. I checked the Lit element and also didn't see any issues there. Even after removing the await overlay.updateComplete
line, but that makes some tests fail, so it could be something so quick I wasn't able to notice, so it might be better to keep it.
Quality Gate passedIssues Measures |
…7528) Co-authored-by: Serhii Kulykov <[email protected]>
This ticket/PR has been released with Vaadin 24.5.0.alpha5 and is also targeting the upcoming stable 24.5.0 version. |
Description
Fixes vaadin/flow-components#6368
This fixes a regression introduced by #7015 where setting
positionTarget
was delayed. It turns out we only need to wait forupdateComplete
when using Lit so that overlay rect is measured (no need to wait untilvaadin-overlay-open
).With this approach, the logic setting
positionTarget
toundefined
and removingstyle
attribute turns out to be unnecessary and even problematic (as it's what caused blinking at the bottom of the screen), so I removed it.Note: I couldn't find an easy approach to test this. However, existing tests for sub-menu position do cover the new code.
Type of change