-
Notifications
You must be signed in to change notification settings - Fork 461
[NavLink] Track active state for menu items with an OnClick handler #3999
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3177c88
Track active state for menu items with an OnClick handler
vnbaaij 8365c7f
Merge branch 'dev' into users/vnbaaij/fix-issue-#3992
vnbaaij 65f0a85
Update verified files after adding span to rendered content
vnbaaij 8e0b85f
Merge branch 'dev' into users/vnbaaij/fix-issue-#3992
vnbaaij 07eb2d4
Merge branch 'dev' into users/vnbaaij/fix-issue-#3992
vnbaaij 92ed198
Merge branch 'dev' into users/vnbaaij/fix-issue-#3992
vnbaaij File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,21 @@ | ||
| | ||
| <FluentStack Orientation="Orientation.Horizontal"> | ||
| <!-- Menu item without callback --> | ||
| <FluentNavMenu> | ||
| <FluentNavLink Href="/issue-tester">Item 1</FluentNavLink> | ||
| </FluentNavMenu> | ||
|
|
||
| <!-- Menu item with event callback --> | ||
| <FluentNavMenu> | ||
| <FluentNavLink Href="/issue-tester" OnClick="OnClick">Item 1</FluentNavLink> | ||
| </FluentNavMenu> | ||
| <FluentNavMenu> | ||
| <FluentNavLink Href="/issue-tester2" OnClick="OnClick">Item 2</FluentNavLink> | ||
| </FluentNavMenu> | ||
|
|
||
| </FluentStack> | ||
| @code { | ||
| private void OnClick() | ||
| { | ||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
tests/Core/NavMenu/FluentNavLinkTests.FluentNavLink_Default.verified.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,13 @@ | ||
|
|
||
| <div class="fluent-nav-item" role="menuitem" b-95x3e3vb5e=""> | ||
| <div class="positioning-region" b-95x3e3vb5e=""> | ||
| <div class="content-region" b-95x3e3vb5e=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-95x3e3vb5e=""> | ||
| <span class="fluent-nav-icon" style="min-width: 20px;" b-95x3e3vb5e=""></span> | ||
| <div class="fluent-nav-text" b-95x3e3vb5e="">NavLink text</div> | ||
| <div class="fluent-nav-item" role="menuitem" b-5upkyn31e7=""> | ||
| <span b-5upkyn31e7=""> | ||
| <div class="positioning-region" b-5upkyn31e7=""> | ||
| <div class="content-region" b-5upkyn31e7=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-5upkyn31e7=""> | ||
| <span class="fluent-nav-icon" style="min-width: 20px;" b-5upkyn31e7=""></span> | ||
| <div class="fluent-nav-text " b-5upkyn31e7="">NavLink text</div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </span> | ||
| </div> |
18 changes: 10 additions & 8 deletions
18
tests/Core/NavMenu/FluentNavLinkTests.FluentNavLink_ExtendedTitle.verified.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
|
|
||
| <div class="fluent-nav-item" role="menuitem" b-95x3e3vb5e=""> | ||
| <div class="positioning-region" b-95x3e3vb5e=""> | ||
| <div class="content-region" b-95x3e3vb5e=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-95x3e3vb5e=""> | ||
| <span class="fluent-nav-icon" style="min-width: 20px;" b-95x3e3vb5e=""></span> | ||
| <div class="fluent-nav-text" b-95x3e3vb5e=""> | ||
| <h3>NavLink text</h3> | ||
| <div class="fluent-nav-item" role="menuitem" b-5upkyn31e7=""> | ||
| <span b-5upkyn31e7=""> | ||
| <div class="positioning-region" b-5upkyn31e7=""> | ||
| <div class="content-region" b-5upkyn31e7=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-5upkyn31e7=""> | ||
| <span class="fluent-nav-icon" style="min-width: 20px;" b-5upkyn31e7=""></span> | ||
| <div class="fluent-nav-text " b-5upkyn31e7=""> | ||
| <h3>NavLink text</h3> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </span> | ||
| </div> |
20 changes: 11 additions & 9 deletions
20
tests/Core/NavMenu/FluentNavLinkTests.FluentNavLink_Icon.verified.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
|
|
||
| <div class="fluent-nav-item" role="menuitem" b-95x3e3vb5e=""> | ||
| <div class="positioning-region" b-95x3e3vb5e=""> | ||
| <div class="content-region" b-95x3e3vb5e=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-95x3e3vb5e=""> | ||
| <svg class="fluent-nav-icon" style="width: 20px; fill: var(--accent-fill-rest);" focusable="false" viewBox="0 0 24 24" aria-hidden="true" blazor:onclick="2"> | ||
| <path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 8.25a1 1 0 0 0-1 .88v5.74a1 1 0 0 0 2 0v-5.62l-.01-.12a1 1 0 0 0-1-.88Zm0-3.75A1.25 1.25 0 1 0 12 9a1.25 1.25 0 0 0 0-2.5Z"></path> | ||
| </svg> | ||
| <div class="fluent-nav-text" b-95x3e3vb5e="">NavLink text</div> | ||
| <div class="fluent-nav-item" role="menuitem" b-5upkyn31e7=""> | ||
| <span b-5upkyn31e7=""> | ||
| <div class="positioning-region" b-5upkyn31e7=""> | ||
| <div class="content-region" b-5upkyn31e7=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-5upkyn31e7=""> | ||
| <svg class="fluent-nav-icon" style="width: 20px; fill: var(--accent-fill-rest);" focusable="false" viewBox="0 0 24 24" aria-hidden="true" blazor:onkeydown="2" blazor:onclick="3"> | ||
| <path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 8.25a1 1 0 0 0-1 .88v5.74a1 1 0 0 0 2 0v-5.62l-.01-.12a1 1 0 0 0-1-.88Zm0-3.75A1.25 1.25 0 1 0 12 9a1.25 1.25 0 0 0 0-2.5Z"></path> | ||
| </svg> | ||
| <div class="fluent-nav-text " b-5upkyn31e7="">NavLink text</div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </span> | ||
| </div> |
20 changes: 11 additions & 9 deletions
20
tests/Core/NavMenu/FluentNavLinkTests.FluentNavLink_IconAndIconColor.verified.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
|
|
||
| <div class="fluent-nav-item" role="menuitem" b-95x3e3vb5e=""> | ||
| <div class="positioning-region" b-95x3e3vb5e=""> | ||
| <div class="content-region" b-95x3e3vb5e=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-95x3e3vb5e=""> | ||
| <svg class="fluent-nav-icon" style="width: 20px; fill: var(--neutral-foreground-rest);" focusable="false" viewBox="0 0 24 24" aria-hidden="true" blazor:onclick="2"> | ||
| <path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 8.25a1 1 0 0 0-1 .88v5.74a1 1 0 0 0 2 0v-5.62l-.01-.12a1 1 0 0 0-1-.88Zm0-3.75A1.25 1.25 0 1 0 12 9a1.25 1.25 0 0 0 0-2.5Z"></path> | ||
| </svg> | ||
| <div class="fluent-nav-text" b-95x3e3vb5e="">NavLink text</div> | ||
| <div class="fluent-nav-item" role="menuitem" b-5upkyn31e7=""> | ||
| <span b-5upkyn31e7=""> | ||
| <div class="positioning-region" b-5upkyn31e7=""> | ||
| <div class="content-region" b-5upkyn31e7=""> | ||
| <div class="fluent-nav-link" blazor:onclick="1" b-5upkyn31e7=""> | ||
| <svg class="fluent-nav-icon" style="width: 20px; fill: var(--neutral-foreground-rest);" focusable="false" viewBox="0 0 24 24" aria-hidden="true" blazor:onkeydown="2" blazor:onclick="3"> | ||
| <path d="M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 8.25a1 1 0 0 0-1 .88v5.74a1 1 0 0 0 2 0v-5.62l-.01-.12a1 1 0 0 0-1-.88Zm0-3.75A1.25 1.25 0 1 0 12 9a1.25 1.25 0 0 0 0-2.5Z"></path> | ||
| </svg> | ||
| <div class="fluent-nav-text " b-5upkyn31e7="">NavLink text</div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </span> | ||
| </div> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.