Fix "stuck" drag/drop controls using ControlFocusExited (#2828)
* #1449 use new ControlFocusExited override for drag/drop controls to avoid getting "stuck" dragging when the control lost focus mid drag, also use the renamed KeyboardFocusEntered/Exited methods. * Update Content.Client/UserInterface/ActionMenuItem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> * Update ActionMenuItem.cs Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
@@ -327,6 +327,14 @@ namespace Content.Client.UserInterface.Controls
|
||||
DrawModeChanged();
|
||||
}
|
||||
|
||||
protected override void ControlFocusExited()
|
||||
{
|
||||
// lost focus for some reason, cancel the drag if there is one.
|
||||
base.ControlFocusExited();
|
||||
_actionsUI.DragDropHelper.EndDrag();
|
||||
DrawModeChanged();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cancel current press without triggering the action
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user