fix(ui/treeview): dismiss right-click context menu when a menu item runs
The custom right-click context menu didn't close after a menu item opened a modal dialog (e.g. "Compose into…"), leaving the menu floating behind the modal until the user clicked elsewhere or hit Escape. Add @onclick="DismissContextMenu" on the menu container so any click inside it (button, divider, padding) closes the menu after the button's own handler bubbles up.
This commit is contained in:
@@ -23,6 +23,7 @@ else
|
|||||||
{
|
{
|
||||||
<div class="tv-ctx-overlay" @onclick="DismissContextMenu" style="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1049;background:transparent;"></div>
|
<div class="tv-ctx-overlay" @onclick="DismissContextMenu" style="position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1049;background:transparent;"></div>
|
||||||
<div class="dropdown-menu show" tabindex="-1" @ref="_contextMenuRef" @onkeydown="OnContextMenuKeyDown"
|
<div class="dropdown-menu show" tabindex="-1" @ref="_contextMenuRef" @onkeydown="OnContextMenuKeyDown"
|
||||||
|
@onclick="DismissContextMenu"
|
||||||
style="position:fixed;top:@(_contextMenuY)px;left:@(_contextMenuX)px;z-index:1050;outline:none;">
|
style="position:fixed;top:@(_contextMenuY)px;left:@(_contextMenuX)px;z-index:1050;outline:none;">
|
||||||
@ContextMenu(_contextMenuItem)
|
@ContextMenu(_contextMenuItem)
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user