forked from vaadin/flow-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix setting class name to menu-bar items in overflow (vaadin#6209)
* fix: fix setting class name to menu-bar items in overflow The changes done in vaadin#6031 doesn't work if the root item is inside the overflow part of the `MenuBar`. That happens because the `setClassName` method in connector changes the `className` value in the `component._item` object that should be reflected to the item when the items are regenerated. Usually, the `_item` object of `component` refers to one instance inside of the `__generatedItems` array in the menu bar instance, but when the menu item becomes part of the overflow, it receives a new instance of `_item` and the reference is lost. Saving the original reference in another property solves the issue and now the class name is changed properly for items inside the overflow. * test: check for class name changes in overflow item * refactor: apply review suggestions * fix: use _item when _rootItem is undefined (submenu items) * test: add test checking item in and out overflow
- Loading branch information
1 parent
b935837
commit ee2443e
Showing
3 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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