From 3ca6a1ba9646899c3369ba986abcc195a3829117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=A8=E6=9C=A8=E5=A4=B4?= Date: Wed, 14 Oct 2020 17:42:57 +0800 Subject: [PATCH] fix(module: dropdown): context menu would show on "OnClick" event (#678) Co-authored-by: James Yeung --- components/core/Component/overlay/OverlayTrigger.razor.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/core/Component/overlay/OverlayTrigger.razor.cs b/components/core/Component/overlay/OverlayTrigger.razor.cs index e3ac6b70..1f6efca6 100644 --- a/components/core/Component/overlay/OverlayTrigger.razor.cs +++ b/components/core/Component/overlay/OverlayTrigger.razor.cs @@ -202,7 +202,7 @@ namespace AntDesign.Internal protected virtual async Task OnTriggerClick() { - if (IsContainTrigger(TriggerType.Click) || IsContainTrigger(TriggerType.ContextMenu)) + if (IsContainTrigger(TriggerType.Click)) { if (_overlay.IsPopup()) { @@ -213,6 +213,10 @@ namespace AntDesign.Internal await Show(); } } + else if (IsContainTrigger(TriggerType.ContextMenu) && _overlay.IsPopup()) + { + await Hide(); + } } protected virtual async Task OnTriggerContextmenu(MouseEventArgs args)