-
Notifications
You must be signed in to change notification settings - Fork 83
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
feat: allow matching navigation hierarchies with side nav item #7693
Conversation
Thanks Sascha! 🙇♂️ Votes for 24.5 inclusion |
We are (theoretically) very close to beta, so I'm not sure. Will bring it up with the team on Monday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally avoid boolean properties which default to true
as it's problematic:
For a Boolean property to be configurable from markup, it must default to false. If it defaults to true, you cannot set it to false from markup, since the presence of the attribute, with or without a value, equates to true. This is the standard behavior for attributes in the web platform.
If we want to make matchExact
the default behavior, then IMO we could instead have a property called noExactMatch
or something else so that its default would be false
.
Changed the property to |
abdda3e
to
a2da683
Compare
Quality Gate passedIssues Measures |
This ticket/PR has been released with Vaadin 24.5.0.alpha12 and is also targeting the upcoming stable 24.5.0 version. |
Adds a
matchNested
property tovaadin-side-nav-item
that allows an item to match nested paths. When enabled, then an item with the path/users
does not only match/users
, but also/users/1
,/users/1/permissions
, etc.For context, the Flow
RouterLink
and React RouterNavLink
have similar options:RouterLink
allows setting aHighlightCondition
that determines whether the link is considered active or not. The most useful default implementations areHighlightConditions.sameLocation
(exact match) andHighlightConditions.locationPrefix
(match prefix).NavLink
has anend
property to force exact matching, otherwise it matches by prefix.Note that both
RouterLink
andNavLink
use prefix matching by default, while side nav item would keep using exact matching by default. For now we keep the default behavior to avoid breaking changes. We can consider aligning the defaults in a future major.Closes vaadin/flow-components#5227