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.58k stars 269 forks source link

[ui-side-navigation-sub-itm]: Wrong focus when click on category header #10179

Open JohannesDoberer opened 1 week ago

JohannesDoberer commented 1 week ago

Issue Description

Behaviour: I have a category expanded and the first sub item is selected + corresponding view will be displayed in the content area. Bildschirmfoto 2024-11-14 um 15 06 27

When I click on the category header (not the arrow) and the header click doesn't trigger any navigation event, which means view in content area represents sub item, the focus will be changed to category header and the category does not collapse. Bildschirmfoto 2024-11-14 um 15 06 51

Expected: I would expect that the category would collapse and focus will stay on the sub-item, when I click on the category name. e.g. like here: https://fiddle.luigi-project.io/#/home/overview

UI5 Web Components Version 2.4.0

dobrinyonkov commented 1 week ago

Hello @JohannesDoberer,

This approach seems to involve a custom logic that may not be widely wanted across applications. You can accomplish this using the ui5-click event for the side navigation items.

Here’s an example

Click on the "People" item to observe how the expanded state of the node toggles. For implementation details, refer to the main.js file in the example. Let us know if this solution works for you.

Kind Regards, Dobrin

JohannesDoberer commented 1 week ago

Hello Dobrin, thank you for the workaround.

I'm referring more on the selected ui5-side-navigation-item.

We want a click-handler on the ui5-side-navigation-item that has ui5-side-navigation-sub-item without selecting the clicked ui5-side-navigation-item. The use case is that if there is no "navigation event" on the category title it can be confusing when it is focused. Perhaps an event.preventDefault would help.

Probably I have to correct myself... it's not a bug it's more a feature request.

Best, Johannes

dobrinyonkov commented 6 days ago

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

Could you please check on this feature reuqest?

Best Regards, Dobrin