Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
When adding a submenu in a toolbar, clicking on the corresponding button always opens the menu, whether the SubmenuToolbarView is in State.DISABLED or not.
This is because a submenu is made of a ToolbarToggleButton and a SubmenuToolbarWidget (which itself is an AbstractToolbarButton) both controlling the same ToolbarButtonUi.
Calling setState(State.DISABLED) on the SubmenuToolbarWidget (returned as a SubmenuToolbarView by the addSubmenu method) calls setState(State.DISABLED) on the ToolbarButtonUi so the button appears disabled; but the ToolbarToggleButton isn't updated, so it's internal check for !isDisabled() in its onClick method fails and it always toggles the button.