Skip to content

Commit

Permalink
chore: Further cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Aug 20, 2024
1 parent 72bf655 commit 4e2c564
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
using CCalendarViewBaseItemChrome = Microsoft.UI.Xaml.Controls.CalendarViewBaseItem;
using DateTime = Windows.Foundation.WindowsFoundationDateTime;
using Uno.UI.Xaml;
using Uno.UI.Extensions;


#if HAS_UNO_WINUI
using Microsoft.UI.Input;
Expand Down Expand Up @@ -293,8 +295,8 @@ internal bool FocusSelfOrChild(

if (spItemToFocus is { })
{
var focused = FocusManager.SetFocusedElementWithDirection(spItemToFocus, focusState, false /* animateIfBringIntoView */, false, focusNavigationDirection);
pFocused = !focused;
var focused = this.SetFocusedElementWithDirection(spItemToFocus, focusState, false /* animateIfBringIntoView */, focusNavigationDirection);
pFocused = focused;
}

return pFocused;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Uno.Extensions;
using DayOfWeek = Windows.Globalization.DayOfWeek;
using DateTime = Windows.Foundation.WindowsFoundationDateTime;
using Uno.UI.Extensions;

namespace Microsoft.UI.Xaml.Controls
{
Expand Down Expand Up @@ -2134,7 +2135,7 @@ private void OnDisplayModeChanged(

//A control must be focused before we can set Engagement on it, attempt to set focus first
bool focused = false;
focused = FocusManager.SetFocusedElementWithDirection(spScrollViewer, FocusState.Keyboard, false /*animateIfBringintoView*/, false, FocusNavigationDirection.None);
focused = this.SetFocusedElementWithDirection(spScrollViewer, FocusState.Keyboard, false /*animateIfBringintoView*/, FocusNavigationDirection.None);
if (focused)
{
FocusManager.SetEngagedControl(spScrollViewer);
Expand Down
3 changes: 2 additions & 1 deletion src/Uno.UI/UI/Xaml/Input/FocusManager.mux.static.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ private bool SetFocusedElement(
focusState,
animateIfBringIntoView,
forceBringIntoView,
focusNavigationDirection);
focusNavigationDirection,
false);

return pFocusUpdated;
}
Expand Down

0 comments on commit 4e2c564

Please sign in to comment.