mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
fix(module: dialog): click dialog cause the mask click event triggered (#1727)
This commit is contained in:
parent
300123045f
commit
d07e3cb8fc
@ -9,7 +9,6 @@
|
|||||||
}
|
}
|
||||||
<div tabindex="-1" id=@($"{Config.PrefixCls}-wrap_{DialogWrapperId}") class=@($"{Config.PrefixCls}-wrap {Config.GetWrapClassNameExtended()}") role="dialog"
|
<div tabindex="-1" id=@($"{Config.PrefixCls}-wrap_{DialogWrapperId}") class=@($"{Config.PrefixCls}-wrap {Config.GetWrapClassNameExtended()}") role="dialog"
|
||||||
@onclick="@EventUtil.AsNonRenderingEventHandler(OnMaskClick)"
|
@onclick="@EventUtil.AsNonRenderingEventHandler(OnMaskClick)"
|
||||||
@onmouseup="@EventUtil.AsNonRenderingEventHandler(OnMaskMouseUp)"
|
|
||||||
@onkeydown="@OnKeyDown"
|
@onkeydown="@OnKeyDown"
|
||||||
style="@_wrapStyle">
|
style="@_wrapStyle">
|
||||||
<div @ref="@_modal" role="document" class=@($"{Config.PrefixCls} {GetModalClsName()}")
|
<div @ref="@_modal" role="document" class=@($"{Config.PrefixCls} {GetModalClsName()}")
|
||||||
|
@ -138,20 +138,20 @@ namespace AntDesign
|
|||||||
_dialogMouseDown = true;
|
_dialogMouseDown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task OnMaskMouseUp()
|
|
||||||
{
|
|
||||||
if (Config.MaskClosable && _dialogMouseDown)
|
|
||||||
{
|
|
||||||
await Task.Delay(4);
|
|
||||||
_dialogMouseDown = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task OnMaskClick()
|
private async Task OnMaskClick()
|
||||||
{
|
{
|
||||||
if (Config.MaskClosable && !_dialogMouseDown)
|
if (Config.MaskClosable)
|
||||||
{
|
{
|
||||||
await CloseAsync();
|
if (_dialogMouseDown)
|
||||||
|
{
|
||||||
|
// mask area union dialog area is clicked.
|
||||||
|
_dialogMouseDown = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// mask area erased by dialog area is clicked.
|
||||||
|
await CloseAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user