Skip to content

Possible FocusZone logic error #4317

Closed

Description

@acoates-ms

auto candidate = winrtComp::FocusManager::FindLastFocusableElement(node);

FocusOutsideZone(..., forward=false) starts from PreOrderPrevious(container), but when the FocusZone has no previous sibling, PreOrderPrevious(container) returns the parent. Calling FindLastFocusableElement(parent) then searches the parent's entire descendant subtree, which can select an element inside this FocusZone or a later sibling after it, so Shift+Tab can re-enter the zone or jump forward instead of moving to the previous element outside the zone.

Please fix the backward traversal to skip the FocusZone subtree and later siblings: when there is no previous sibling, consider the parent itself or keep climbing to the parent's previous sibling. Add a native focus traversal test for a FocusZone that is the first child and has later siblings.

Internal link: https://office.visualstudio.com/DefaultCollection/Office/_git/Office/pullRequest/5751726?discussionId=73697562#1790023382

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions