Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b38854e
Unified where the class mud-popover-provider comes from
versile2 Apr 4, 2025
f780f3a
Enhance popover functionality and cleanup code
versile2 Apr 4, 2025
964a66c
save to travel home still optimizing flip methods
versile2 Apr 4, 2025
7dc0d1d
flipping logic check complete
versile2 Apr 4, 2025
17ccef9
Improve readability and maintainability of mudPopover.js
versile2 Apr 5, 2025
4a2ccde
test viewer cases
versile2 Apr 5, 2025
ab2fac0
updated changes, still working on anchorpoint and top section
versile2 Apr 6, 2025
d8aeb36
final adjustments to flipping and mud-list overflow logic
versile2 Apr 7, 2025
97ed340
revert tooltip not in dom
versile2 Apr 7, 2025
11706b5
add overflowpadding to initialize
versile2 Apr 7, 2025
17ebfad
refactor, add overflow from options
versile2 Apr 7, 2025
507e90c
re-ordered initial flow and delayed hide
versile2 Apr 7, 2025
30fdd11
remove extra console messages
versile2 Apr 8, 2025
c7976e2
change to flip margin and get properheight and width from contentnode…
versile2 Apr 8, 2025
b0e1101
state save, reordered a few things for smoother processing
versile2 Apr 8, 2025
e2009e0
change from list to content node, remove extra logging, fix incorrect…
versile2 Apr 8, 2025
5381e01
adjust tests
versile2 Apr 8, 2025
725de88
Merge branch 'MudBlazor:dev' into refactor/popovers
versile2 Apr 8, 2025
4563571
Merge branch 'MudBlazor:dev' into refactor/popovers
versile2 Apr 8, 2025
51c292a
added unit test for partials
versile2 Apr 9, 2025
cc146bf
initial review changes
versile2 Apr 9, 2025
a0ab49f
regression fix for mudmenu, includes a new viewer case
versile2 Apr 11, 2025
86af6b9
removed extra console.log
versile2 Apr 11, 2025
692329c
nit
ScarletKuro Apr 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
nit
  • Loading branch information
ScarletKuro committed Apr 19, 2025
commit 692329cb313599ca4d52ef1e95a420b1e1030ce4
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<MudPaper style="width: 70px;">
@* On initial load these don't respect the mouseover leave event only activating and not deactivating *@
<MudNavMenu>
@foreach (var menu in menuList)
@foreach (var menu in _menuList)
{
<MudMenu Icon="@Icons.Material.Filled.Mouse" FullWidth="true" ActivationEvent="@MouseEvent.MouseOver"
AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.CenterLeft">
Expand Down Expand Up @@ -174,6 +174,6 @@

@code {
public static string __description__ = "4 menu edge cases for visual testing, initial load, in appbar, nested, and in dialog.";
private readonly string[] menuList = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
private bool _visible = false;
private readonly string[] _menuList = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
private bool _visible;
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<MudStack Spacing="2">
<MudButton OnClick="OnExpandCollapseClick">@(_expanded ? "Collapse" : "Expand")</MudButton>
<MudButton OnClick="OnExpandCollapseFor5sClick">@(_expanded ? "Collapse" : "Expand") for 5 s</MudButton>
<MudButton OnClick="OnExpandListIn5s">Expand list in 5 s</MudButton>
<MudButton OnClick="OnExpandCollapseFor5sClickAsync">@(_expanded ? "Collapse" : "Expand") for 5 s</MudButton>
<MudButton OnClick="OnExpandListIn5sAsync">Expand list in 5 s</MudButton>
<MudDivider />
<MudCollapse Expanded="_expanded">
<div style="@($"height: {_height}px")">
<MudNumericField T="Int32" @bind-Value="_height" Min="0" Label="Section height (in px)" />
<MudCheckBox T="Boolean" @bind-Value="_hideBottom" Label="Hide bottom section" />
<MudNumericField T="int" @bind-Value="_height" Min="0" Label="Section height (in px)" />
<MudCheckBox T="bool" @bind-Value="_hideBottom" Label="Hide bottom section" />
<MudSelect T="Origin"
Label="Anchor Origin"
@bind-Value="@_anchor">
Expand Down Expand Up @@ -71,48 +71,42 @@
@if (!_hideBottom)
{
<MudButton OnClick="OnExpandCollapseClick">@(_expanded ? "Collapse" : "Expand")</MudButton>
<MudButton OnClick="OnExpandCollapseFor5sClick">@(_expanded ? "Collapse" : "Expand") for 5 s</MudButton>
<MudButton OnClick="OnExpandCollapseFor5sClickAsync">@(_expanded ? "Collapse" : "Expand") for 5 s</MudButton>
<MudDivider />
<MudCollapse Expanded="_expanded">
<div style="@($"height: {_heightBottom}px")">
<MudNumericField T="Int32" @bind-Value="_heightBottom" Min="0" Label="Section height (in px)" />
<MudNumericField T="int" @bind-Value="_heightBottom" Min="0" Label="Section height (in px)" />
</div>
</MudCollapse>
}
</MudStack>
@code {



public static string __description__ = "Popover should take the best available space";

private Int32 _height = 600;
private Int32 _heightBottom = 400;
private bool _hideBottom;
private bool _expandList;
private bool _expanded = true;
private int _height = 600;
private int _heightBottom = 400;
private Origin _anchor = Origin.BottomLeft;
private Origin _transform = Origin.TopLeft;
private bool _expanded = true;

private readonly DropdownSettings _dropdownSettings = new DropdownSettings
{
private readonly DropdownSettings _dropdownSettings = new()
{
OverflowBehavior = OverflowBehavior.FlipAlways
};

private void OnExpandCollapseClick()
{
_expanded = !_expanded;
}
private void OnExpandCollapseClick() => _expanded = !_expanded;

private async Task OnExpandCollapseFor5sClick()
private async Task OnExpandCollapseFor5sClickAsync()
{
var cur = _expanded;
_expanded = !cur;
await Task.Delay(5000);
_expanded = cur;
}
var expanded = _expanded;
_expanded = !expanded;
await Task.Delay(5000);
_expanded = expanded;
}

private async Task OnExpandListIn5s()
private async Task OnExpandListIn5sAsync()
{
_expandList = false;
await Task.Delay(5000);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

<MudContainer Fixed="true" @key="_key">
<MudContainer Fixed="true" @key="_key">
@for (var i = 0; i < 200; i++)
{
<div>
@{
var current = i;
}
<MudTooltip Text="Tooltext buttontip" Delay="0" Duration="0">
<MudButton>BTN @i</MudButton>
<MudButton>BTN @current</MudButton>
</MudTooltip>
</div>
}
Expand All @@ -16,17 +18,18 @@

protected override Task OnInitializedAsync()
{
RunThing().CatchAndLog();
var cts = new CancellationTokenSource();
RunThingAsync(cts.Token).CatchAndLog();
return base.OnInitializedAsync();
}

private async Task RunThing()
private async Task RunThingAsync(CancellationToken cancellationToken)
{
while (true)
while (!cancellationToken.IsCancellationRequested)
{
this._key = Guid.NewGuid();
_key = Guid.NewGuid();
InvokeAsync(StateHasChanged).CatchAndLog();
await Task.Delay(100);
await Task.Delay(100, cancellationToken);
}
}
}
2 changes: 1 addition & 1 deletion src/MudBlazor/Components/Tooltip/MudTooltip.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MudBlazor
#nullable enable
public partial class MudTooltip : MudComponentBase
{
internal readonly ParameterState<bool> _visibleState;
private readonly ParameterState<bool> _visibleState;
private Origin _anchorOrigin;
private Origin _transformOrigin;
public MudTooltip()
Expand Down