Add 'open' attribute in Menu component
Feature Request Description
When the user clicks the Menu button while the menu is opened, we want it to close https://sap.github.io/ui5-webcomponents/playground/components/Menu/
Something like:
const onButtonClick = () => {
if (buttonRef.current.opened) {
menuRef.current.close();
} else {
menuRef.current.showAt(buttonRef.current);
}
};
Proposed Solution
Add opened attribute so we can check whether we should close this menu
Priority
- [ ] Low
- [x] Medium
- [ ] High
- [ ] Very High
Stakeholder Info (if applicable)
- Organization: {JAM}
Hi @SAP/ui5-webcomponents-topic-b,
Could you take a look at this feature request for ui5-menu?
Regards, Stanislav
Hi all,
+1 for this. I'd suggest an implementation similar to that of Popover, adding "open" & "opener" props, allowing the consumers to not have to deal with refs anymore.
Thanks in advance!
Hi @TinaC and @ej612,
We will adopt "open" & "opener" methods from Popover, as described in https://github.com/SAP/ui5-webcomponents/issues/5095.
Best regards, Petya
Hi @petyabegovska,
Thanks a lot for the update! Kindly keep us posted once this has made its way into a new version :)
Best regards