Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a SideNavigation component #1871

Closed
vladitasev opened this issue Jun 25, 2020 · 5 comments · Fixed by #1889
Closed

Create a SideNavigation component #1871

vladitasev opened this issue Jun 25, 2020 · 5 comments · Fixed by #1889
Assignees

Comments

@vladitasev
Copy link
Contributor

No description provided.

@vladitasev
Copy link
Contributor Author

@MarcusNotheis
Copy link
Collaborator

Hey @vladitasev,
any chance to consider this issue as well in your implementation?

@fifoosid
Copy link
Contributor

fifoosid commented Jul 1, 2020

Hello @MarcusNotheis

Currently the desired behaviour can be implemented inside the application using ui5-side-navigation. Every ui-side-navigation-item has expandable and expanded properties. When a selection-change occurs in the ui5-side-navigation, in the event detail you can find the pressed item as well as a second parameter isArrowClicked. When it is true, it means that the user has pressed the arrow and the expanded attribute will be set to true. On the other hand, if it is false, the application can toggle the item instead of doing a navigation which is the desired behaviour.

I just tested it out and it works as expected:

$0.addEventListener("ui5-selection-change", event => {
    if (!event.detail.isArrowClicked) {
        event.detail.item.expanded = !event.detail.item.expanded;
    }
});

@MarcusNotheis
Copy link
Collaborator

Thanks @fifoosid, that's exactly what we have been looking for :)

@fifoosid
Copy link
Contributor

Hello @MarcusNotheis

A quick update from our side: We changed the internal implementation of the ui5-side-navigation. Now selection-change event is not thrown when the arrow is clicked. This way it would be even easier to achieve the desired behaviour. All you have to do is check if the item is expandable or not in order to know whether to navigate or toggle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants