-
Notifications
You must be signed in to change notification settings - Fork 159
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
[Bug Report]: MasaBlazor.BreakpointChanged触发过于频繁 #2067
Labels
Milestone
Comments
@Yu-Core 你需要确切地知道从什么断点到什么断点吗?你是通过inject MasaBlazor还是inject Breakpoint来使用的? |
inject MasaBlazor
|
@Yu-Core SmAndUpChanged 这些比较繁琐,只提供一个断点也行吧 你的写法: private void MasaBlazorOnBreakpointChanged(object? sender, MyBreakpointChangedEventArgs e)
{
if (e.SmAndUpChanged)
{
InvokeAsync(StateHasChanged);
}
} 新支持的写法: private void MasaBlazorOnBreakpointChanged(object? sender, BreakpointChangedEventArgs e)
{
// e.Breakpoint 为当前断点 Xs,Sm,Md,Lg,Xl 其中之一
if (e.Breakpoint > Breakpoints.Xs)
{
InvokeAsync(StateHasChanged);
}
} |
有道理,还是你的写法更合理一些 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Masa.Blazor version
1.6.4
Describe the bug
按理说应该只在断点改变时才会触发
但实际上,只要窗口宽度或高度改变,哪怕是同一断点,依然被触发
https://github.com/masastack/MASA.Blazor/blob/main/src/Masa.Blazor/Services/Breakpoint/Breakpoint.cs#L125
Expected Behavior
No response
Steps To Reproduce
No response
Reproduction code
No response
.NET version
No response
What browsers are you seeing the problem on?
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: