Skip to content
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: observe parent resize to detect overflow #3824

Merged
merged 3 commits into from
May 12, 2022

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented May 11, 2022

Description

Added ResizeObserver for the menu-bar parent to detect cases when its width increases.

Note, this does not cover the following case described in the original issue:

Changing of the content -> Update view title to be longer (e.g. upon navigation), MenuBar overflow is created, update title to be shorter overflow is not being updated.

Fixes #3739

Type of change

  • Bugfix

disconnectedCallback() {
super.disconnectedCallback();

this.__parentResizeObserver.unobserve(this.__parent);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what would be a proper way to test this, maybe will have to use a long timeout 🤷‍♂️

@sonarcloud
Copy link

sonarcloud bot commented May 12, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan web-padawan merged commit fe7ccba into master May 12, 2022
@web-padawan web-padawan deleted the fix/menu-bar-parent-resize branch May 12, 2022 10:33
web-padawan added a commit that referenced this pull request May 12, 2022
Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MenuBar overflow / responsiveness does not work in all scenarios
5 participants