SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.52k stars 264 forks source link

[Responsive Popover / MultiCombobox ]: Responsive Popover with State Opener and MCB closes when clicking MCB Item #10006

Open gitgdako opened 6 days ago

gitgdako commented 6 days ago

Describe the bug

{ ResponsivePopover, Button, MultiComboBox, MultiComboBoxItem } from '@ui5/webcomponents-react';

A ResponsivePopover can/shoud be opened using a React State (https://sap.github.io/ui5-webcomponents-react/v2/?path=/docs/modals-popovers-responsivepopover--docs) and closed clicking outside if not modal If the ResponsivePopover contains a MultiCombobox when clicking inside the MCB Popover the close event is propagated to the ResponsivePopover itself which then closes the popover

From the Stackblitz Reproducer:

      const [open, setOpen] = useState(false);
      ...
      <ResponsivePopover
        opener="..."
        open={open}
        // this is necessary to be able to reopen the popup when clicking outside to close it
        onClose={() => setOpen(false)}
      >
        <MultiComboBox
          // this is necessary to prevent the event to be propagated to the responsive popover
          // onClose={(e) => {
          //   e.preventDefault();
          //   e.stopPropagation();
          // }}
        >
          <MultiComboBoxItem key={'key'} text={'Click me'} />
        </MultiComboBox>
      </ResponsivePopover>

Isolated Example

https://stackblitz.com/edit/github-dlhafz

Reproduction steps

  1. https://stackblitz.com/edit/github-dlhafz
  2. Click button -> Responsive Popover opens
  3. Click MCB Arrow down -> MVB Popover opens
  4. Click MCB Element
  5. Responsive Popover closes

Expected Behaviour

Responsive Popover should stay open

Screenshots or Videos

No response

UI5 Web Components for React Version

2.2.0

UI5 Web Components Version

2.3.0

Browser

Chrome

Operating System

Windows 11

Additional Context

No response

Relevant log output

No response

Organization

No response

Declaration

Lukas742 commented 6 days ago

Thanks for reporting! I'll forward this issue to our UI5 Web Components Colleagues as the affected component is developed in their repository.

Similiar issues: https://github.com/SAP/ui5-webcomponents/issues/9484, https://github.com/SAP/ui5-webcomponents/issues/9909

NHristov-sap commented 5 days ago

Hello @ui5-webcomponents-topic-rd,

The issue is reproducible by following the steps listed above, so I am forwarding this issue to you.

Best Regards, Nikolay Hristov

gitgdako commented 8 hours ago

NotificationListItem with showClose on pressing the Close/X Button within a ResponsivePopover has the same issue