Skip to content

refactor: extract method for updating overflow - #3826

Merged
web-padawan merged 1 commit into
masterfrom
refactor/menu-bar-overflow
May 11, 2022
Merged

web-padawan merged 1 commit into
masterfrom
refactor/menu-bar-overflow

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

The original issue contains an edge case where container.offsetWidth is 39 and container.scrollWidth is 40: this only happens with certain customizations, see vaadin/flow-components#2810 (comment). I'm not sure if we should test that.

However, it still makes sense to make this logic more clear by ensuring _hasOverflow is only set to true when the count of the items in the overflow sub-menu is greater than 0. This PR makes it explicit by adding another private method.

Fixes vaadin/flow-components#2810

Type of change

  • Refactor

@sonarqubecloud

Copy link
Copy Markdown

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan
web-padawan merged commit f36d549 into master May 11, 2022
@web-padawan
web-padawan deleted the refactor/menu-bar-overflow branch May 11, 2022 11:09
@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @web-padawan , this commit cannot be picked to 23.0 by this bot, can you take a look and pick it manually?
Error Message: Error: Command failed: git cherry-pick f36d549
error: could not apply f36d549... refactor: extract method for updating overflow (#3826)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot

Copy link
Copy Markdown
Collaborator

Hi @web-padawan , this commit cannot be picked to 22.0 by this bot, can you take a look and pick it manually?
Error Message: Error: Command failed: git cherry-pick f36d549
error: could not apply f36d549... refactor: extract method for updating overflow (#3826)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

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 displays empty overflow menu under specific circumstances

3 participants