-
Notifications
You must be signed in to change notification settings - Fork 469
[AppBar] Make OnClick close popover #4518
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 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
052fdb9
Make OnCLick close popover
vnbaaij 9b63345
Only close the popover when in overflowed state
vnbaaij 356780a
Fix spacing
vnbaaij add3019
Fix spacing?
vnbaaij 3e49dfc
More spacing fixes
vnbaaij 5a94641
Even moe spacing ifixes
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
114 changes: 58 additions & 56 deletions
114
examples/Demo/Shared/Pages/AppBar/Examples/AppBarClick.razor
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,72 +1,74 @@ | ||
| @inject IDialogService DialogService | ||
|
|
||
| <FluentStack Orientation="Orientation.Vertical" Style="height: 330px;"> | ||
| <FluentAppBar Style="height: 100%;"> | ||
| <FluentAppBarItem Href="/" | ||
| Match="NavLinkMatch.All" | ||
| IconRest="HomeIcon()" | ||
| IconActive="HomeIcon(active: true)" | ||
| Text="Home" | ||
| OnClick="HandleOnClick" /> | ||
| <FluentAppBarItem Href="/AppBar" | ||
| IconRest="AppBarIcon()" | ||
| IconActive="AppBarIcon(active: true)" | ||
| Text="AppBar" | ||
| OnClick="HandleOnClick" /> | ||
| <FluentAppBarItem IconRest="WhatsNewIcon()" | ||
| IconActive="WhatsNewIcon(active: true)" | ||
| Text="What's New" | ||
| OnClick="ShowSuccessAsync" /> | ||
| <FluentAppBarItem Href="@(null)" | ||
| IconRest="IconsIcon()" | ||
| IconActive="IconsIcon(active: true)" | ||
| Text="Icons" | ||
| OnClick="ShowWarningAsync" /> | ||
| <FluentAppBarItem Href="/Dialog" | ||
| IconRest="DialogIcon()" | ||
| IconActive="DialogIcon(active: true)" | ||
| Text="Dialog" | ||
| OnClick="HandleOnClick" /> | ||
| </FluentAppBar> | ||
| <div style="background-color: var(--neutral-layer-3); overflow: auto; resize: vertical; height: 356px; width: 86px; padding: 10px;"> | ||
| <FluentAppBar Style="height: 100%; background-color: var(--neutral-layer-2);"> | ||
| <FluentAppBarItem Href="/" | ||
| Match="NavLinkMatch.All" | ||
| IconRest="HomeIcon()" | ||
| IconActive="HomeIcon(active: true)" | ||
| Text="Home" | ||
| OnClick="HandleOnClick" /> | ||
| <FluentAppBarItem Href="/AppBar" | ||
| IconRest="AppBarIcon()" | ||
| IconActive="AppBarIcon(active: true)" | ||
| Text="AppBar" | ||
| OnClick="HandleOnClick" /> | ||
| <FluentAppBarItem IconRest="WhatsNewIcon()" | ||
| IconActive="WhatsNewIcon(active: true)" | ||
| Text="What's New" | ||
| OnClick="ShowSuccessAsync" /> | ||
| <FluentAppBarItem Href="@(null)" | ||
| IconRest="IconsIcon()" | ||
| IconActive="IconsIcon(active: true)" | ||
| Text="Icons" | ||
| OnClick="HandleOnClick" /> | ||
| <FluentAppBarItem Href="/Dialog" | ||
| IconRest="DialogIcon()" | ||
| IconActive="DialogIcon(active: true)" | ||
| Text="Dialog" | ||
| OnClick="HandleOnClick" /> | ||
| </FluentAppBar> | ||
| </div> | ||
| </FluentStack> | ||
|
|
||
| @code { | ||
| private static Icon HomeIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.Home() | ||
| : new Icons.Regular.Size24.Home(); | ||
| private static Icon HomeIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.Home() | ||
| : new Icons.Regular.Size24.Home(); | ||
|
|
||
| private static Icon AppBarIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.AppsList() | ||
| : new Icons.Regular.Size24.AppsList(); | ||
| private static Icon AppBarIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.AppsList() | ||
| : new Icons.Regular.Size24.AppsList(); | ||
|
|
||
| private static Icon WhatsNewIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.Info() | ||
| : new Icons.Regular.Size24.Info(); | ||
| private static Icon WhatsNewIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.Info() | ||
| : new Icons.Regular.Size24.Info(); | ||
|
|
||
| private static Icon IconsIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.Symbols() | ||
| : new Icons.Regular.Size24.Symbols(); | ||
| private static Icon IconsIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.Symbols() | ||
| : new Icons.Regular.Size24.Symbols(); | ||
|
|
||
| private static Icon DialogIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.AppGeneric() | ||
| : new Icons.Regular.Size24.AppGeneric(); | ||
| private static Icon DialogIcon(bool active = false) => | ||
| active ? new Icons.Filled.Size24.AppGeneric() | ||
| : new Icons.Regular.Size24.AppGeneric(); | ||
|
|
||
|
|
||
| private void HandleOnClick(IAppBarItem item) | ||
| { | ||
| private void HandleOnClick(IAppBarItem item) | ||
| { | ||
|
|
||
| DemoLogger.WriteLine($"Clicked {item.Text}!"); | ||
| } | ||
| DemoLogger.WriteLine($"Clicked {item.Text}!"); | ||
| } | ||
|
|
||
| private async Task ShowSuccessAsync(IAppBarItem item) | ||
| { | ||
| var dialog = await DialogService.ShowSuccessAsync($"You clicked {item.Text}"); | ||
| var result = await dialog.Result; | ||
| } | ||
| private async Task ShowSuccessAsync(IAppBarItem item) | ||
| { | ||
| var dialog = await DialogService.ShowSuccessAsync($"You clicked {item.Text}"); | ||
| var result = await dialog.Result; | ||
| } | ||
|
|
||
| private async Task ShowWarningAsync(IAppBarItem item) | ||
| { | ||
| var dialog = await DialogService.ShowWarningAsync($"Are you sure? {item.Text}"); | ||
| var result = await dialog.Result; | ||
| } | ||
| private async Task ShowWarningAsync(IAppBarItem item) | ||
| { | ||
| var dialog = await DialogService.ShowWarningAsync($"Are you sure? {item.Text}"); | ||
| var result = await dialog.Result; | ||
| } | ||
| } | ||
4 changes: 2 additions & 2 deletions
4
examples/Demo/Shared/Pages/AppBar/Examples/AppBarFromListOfApps.razor
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
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.