Skip to content

Commit

Permalink
fix: Stop propagating native focus on AllowFocusOnInteraction/IsTabSt…
Browse files Browse the repository at this point in the history
…op = false on WASM
  • Loading branch information
MartinZikmund committed Jan 12, 2022
1 parent 5ded7af commit 44572e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Uno.UI/UI/Xaml/Input/FocusManager.wasm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ internal static void ProcessElementFocused(UIElement element)
_skipNativeFocus = false;
break;
}
else if (
parent is FrameworkElement fe &&
(!fe.AllowFocusOnInteraction || !fe.IsTabStop))
{
// Stop propagating, this element does not want to receive focus.
break;
}
else if (parent is Control control && control.IsFocusable)
{
ProcessControlFocused(control);
Expand Down Expand Up @@ -87,7 +94,7 @@ internal static bool FocusNative(UIElement element)

if (focusManager?.InitialFocus == true)
{
// Do not focus natively on initial focus so the soft keyboard is not opened
// Do not focus natively on initial focus so the soft keyboard is not opened
return false;
}

Expand Down

0 comments on commit 44572e7

Please sign in to comment.