SAP / ui5-webcomponents-react

A wrapper implementation for React of the UI5 Web Components that are compliant with the SAP Fiori User Experience
https://sap.github.io/ui5-webcomponents-react/
Apache License 2.0
444 stars 100 forks source link

[ShellBar]: Child Events in menuItems slot do not fire #5440

Closed f16r closed 9 months ago

f16r commented 9 months ago

Describe the bug

Button click event does not work.

Working "plain" webcomponents example: https://codesandbox.io/p/sandbox/ui5-webcomponents-playground-forked-dw65ml?file=%2Findex.html%3A46%2C20

Not working react example: https://codesandbox.io/p/sandbox/interesting-mendeleev-vrl3mw?file=%2Fsrc%2FApp.js%3A26%2C16

Isolated Example

https://codesandbox.io/p/sandbox/interesting-mendeleev-vrl3mw?file=%2Fsrc%2FApp.js%3A26%2C16

Reproduction steps

  1. Open MenuItems Popover
  2. Click button

Expected Behaviour

onClick event fires, alert is displayed

Screenshots or Videos

No response

UI5 Web Components for React Version

1.23.1

UI5 Web Components Version

1.20.1

Browser

Chrome

Operating System

Win 11

Additional Context

No response

Relevant log output

No response

Declaration

Lukas742 commented 9 months ago

Hi @f16r

menuItems are only supported by list items like StandardListItem or CustomListItem, all other elements or components can lead to unintended side effects. E.g. in this case there are two List components nested in each other, as the slot is wrapped inside a list and you render a list as well. I also tested it using plain ui5-webcomponents without our wrapper in React, and the result is the same. --> codeSandbox

If you feel like it should be possible to customize the menu items more, please open a feature request in the ui5-webcomponents repo, since the component is developed there.