Skip to content

Commit

Permalink
Determine whether a group is explicitly ordered by whether it has ele…
Browse files Browse the repository at this point in the history
…ments as direct descendents
  • Loading branch information
David Brunow committed Dec 30, 2023
1 parent 7f28b36 commit 010671b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,19 @@ private extension NSObject {
let explicitlyOrdered = accessibilityElements.contains {
explicitOrderingExceptionList.contains("\(type(of: $0))") == false
}
let shouldBeExplicitlyOrdered = accessibilityHierarchyOfElements.contains { node in
switch node {
case .element:
// Only set explicitly ordered if an element node is a direct descendent of this group.
return true
case .group:
return false
}
}

recursiveAccessibilityHierarchy.append(.group(
accessibilityHierarchyOfElements,
explicitlyOrdered: explicitlyOrdered,
explicitlyOrdered: shouldBeExplicitlyOrdered,
frameOverrideProvider: (overridesElementFrame(with: contextProvider) ? self : nil)
))

Expand Down

0 comments on commit 010671b

Please sign in to comment.