Skip to content

fix(ui5-side-navigation): collapsed parent items appear as selected if one of its child items is selected #11400

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kskondov
Copy link
Contributor

JIRA: BGSOFUIRODOPI-3383

…f a child items is selected

JIRA: BGSOFUIRODOPI-3383
@kskondov kskondov requested a review from a team April 24, 2025 06:27
@kskondov kskondov requested review from TeodorTaushanov and a team April 29, 2025 10:11
@@ -272,6 +272,14 @@ class SideNavigationItem extends SideNavigationSelectableItemBase {
_toggle() {
if (this.items.length) {
this.expanded = !this.expanded;

if (this.items.some(item => item.selected)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not working when an item is expanded/collapsed via keyboard. Just modify get _selected property to:

get _selected() {
		if (this.sideNavCollapsed || !this.expanded) {
			return this.selected || this.items.some(item => item.selected);
		}

		return this.selected;
	}

as we have similar logic when the whole side nav is collapsed.

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

Successfully merging this pull request may close these issues.

2 participants