Fix focus issues to allow panel scroll bar to be clicked and used.
This commit is contained in:
@@ -32,7 +32,13 @@ namespace FlaxEngine.GUI
|
|||||||
public override void OnEndContainsFocus()
|
public override void OnEndContainsFocus()
|
||||||
{
|
{
|
||||||
base.OnEndContainsFocus();
|
base.OnEndContainsFocus();
|
||||||
|
|
||||||
|
// Dont lose focus when using panel. Does prevent LostFocus even from being called if clicking inside of the panel.
|
||||||
|
if (Children[0] is Panel panel && panel.IsMouseOver && !panel.ContainsFocus)
|
||||||
|
{
|
||||||
|
panel.Focus();
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Call event after this 'focus contains flag' propagation ends to prevent focus issues
|
// Call event after this 'focus contains flag' propagation ends to prevent focus issues
|
||||||
if (LostFocus != null)
|
if (LostFocus != null)
|
||||||
Scripting.RunOnUpdate(LostFocus);
|
Scripting.RunOnUpdate(LostFocus);
|
||||||
@@ -433,6 +439,7 @@ namespace FlaxEngine.GUI
|
|||||||
AnchorPreset = AnchorPresets.StretchAll,
|
AnchorPreset = AnchorPresets.StretchAll,
|
||||||
BackgroundColor = BackgroundColor,
|
BackgroundColor = BackgroundColor,
|
||||||
ScrollBars = ScrollBars.Vertical,
|
ScrollBars = ScrollBars.Vertical,
|
||||||
|
AutoFocus = true,
|
||||||
Parent = popup,
|
Parent = popup,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user