[Mac] [Focus Zone] Restore broken direction = none functionality (#3692)
This commit is contained in:
Родитель
dedb5ef0c6
Коммит
ee36c6f200
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"type": "patch",
|
||||
"comment": "[Mac] [Focus Zone] Restore broken direction = none functionality",
|
||||
"packageName": "@fluentui-react-native/focus-zone",
|
||||
"email": "nakambo@microsoft.com",
|
||||
"dependentChangeType": "patch"
|
||||
}
|
|
@ -538,10 +538,10 @@ static BOOL ShouldSkipFocusZone(NSView *view)
|
|||
|
||||
BOOL forward = action != FocusZoneActionShiftTab;
|
||||
NSView *firstResponder = GetFirstResponder([self window]);
|
||||
NSView *nextViewToFocus = action == forward ? [firstResponder nextValidKeyView] : [firstResponder previousValidKeyView];
|
||||
NSView *nextViewToFocus = forward ? [firstResponder nextValidKeyView] : [firstResponder previousValidKeyView];
|
||||
|
||||
if (nextViewToFocus == self)
|
||||
nextViewToFocus = action == forward ? [nextViewToFocus nextValidKeyView] : [nextViewToFocus previousValidKeyView];;
|
||||
nextViewToFocus = forward ? [nextViewToFocus nextValidKeyView] : [nextViewToFocus previousValidKeyView];;
|
||||
|
||||
if ([@"Normal" isEqual:tabKeyNavigation] || [nextViewToFocus isDescendantOf:self])
|
||||
return nextViewToFocus;
|
||||
|
@ -573,11 +573,7 @@ static BOOL ShouldSkipFocusZone(NSView *view)
|
|||
|
||||
BOOL passthrough = NO;
|
||||
NSView *viewToFocus = nil;
|
||||
if ([self disabled] || action == FocusZoneActionNone
|
||||
|| (focusZoneDirection == FocusZoneDirectionVertical
|
||||
&& (action == FocusZoneActionRightArrow || action == FocusZoneActionLeftArrow))
|
||||
|| (focusZoneDirection == FocusZoneDirectionHorizontal
|
||||
&& (action == FocusZoneActionUpArrow || action == FocusZoneActionDownArrow)))
|
||||
if ([self disabled] || action == FocusZoneActionNone)
|
||||
{
|
||||
passthrough = YES;
|
||||
}
|
||||
|
@ -585,6 +581,14 @@ static BOOL ShouldSkipFocusZone(NSView *view)
|
|||
{
|
||||
viewToFocus = [self nextViewToFocusForTab:action];
|
||||
}
|
||||
else if ((focusZoneDirection == FocusZoneDirectionVertical
|
||||
&& (action == FocusZoneActionRightArrow || action == FocusZoneActionLeftArrow))
|
||||
|| (focusZoneDirection == FocusZoneDirectionHorizontal
|
||||
&& (action == FocusZoneActionUpArrow || action == FocusZoneActionDownArrow))
|
||||
|| (focusZoneDirection == FocusZoneDirectionNone))
|
||||
{
|
||||
passthrough = YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewToFocus = [self nextViewToFocusWithFallback:action considerCircular:[@"NavigateWrap" isEqual:navigateAtEnd]];
|
||||
|
|
Загрузка…
Ссылка в новой задаче