ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

Add 'open' attribute in Menu component

Open TinaC opened this issue 3 years ago • 4 comments

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}

TinaC avatar Jul 25 '22 02:07 TinaC

Hi @SAP/ui5-webcomponents-topic-b,

Could you take a look at this feature request for ui5-menu?

Regards, Stanislav

stbodurov avatar Jul 26 '22 10:07 stbodurov

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!

ej612 avatar Sep 05 '22 13:09 ej612

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

petyabegovska avatar Oct 03 '22 13:10 petyabegovska

Hi @petyabegovska,

Thanks a lot for the update! Kindly keep us posted once this has made its way into a new version :)

Best regards

ej612 avatar Oct 06 '22 14:10 ej612