Skip to content

Commit 970f15b

Browse files
committed
🐛 fix(WindowItem): improve interactivity detection (#2568)
1 parent 16bad22 commit 970f15b

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/Masa.Blazor/Components/Window/MWindowItem.razor.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ public MWindowItem() : base(GroupType.Window, bootable: true)
3636
/// </summary>
3737
public virtual string Tag { get; set; }
3838

39-
protected override bool IsEager => Eager;
39+
/// <summary>
40+
/// Indicates whether this component is interactive. #2567
41+
/// </summary>
42+
private bool _isInteractive;
43+
44+
protected override bool IsEager => Eager || !_isInteractive;
4045

4146
private bool InTransition { get; set; }
4247

@@ -55,6 +60,16 @@ protected string? ComputedTransition
5560
}
5661
}
5762

63+
protected override void OnAfterRender(bool firstRender)
64+
{
65+
base.OnAfterRender(firstRender);
66+
67+
if (firstRender)
68+
{
69+
_isInteractive = true;
70+
}
71+
}
72+
5873
protected async Task HandleOnBefore(ElementReference el)
5974
{
6075
if (InTransition) return;

0 commit comments

Comments
 (0)