Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
maicki committed May 31, 2019
1 parent 9f6394f commit 6e36749
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions Source/ASTextNode2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,14 @@ - (NSArray *)accessibilityElements

NSMutableArray<ASTextNodeAccessiblityElement *> *accessibilityElements = [[NSMutableArray alloc] init];

// Searc the first node that is not layer backed
// Search the first node that is not layer backed
ASDisplayNode *containerNode = ASFirstNonLayerBackedSupernodeForNode(self);
UIAccessibilityTraits accessibilityTraits = self.accessibilityTraits;
ASTextLayout *layout = ASTextNodeCompatibleLayoutWithContainerAndText(_textContainer, attributedText);

// Create an accessibility element to represent the label's text. It's not necessary to specify
// a accessibilityRange here, as the entirety of the text is being represented.
ASTextNodeAccessiblityElement *accessibilityElement = [[ASTextNodeAccessiblityElement alloc] initWithAccessibilityContainer:containerNode.view];
accessibilityElement.accessibilityTraits = accessibilityTraits;
accessibilityElement.accessibilityTraits = self.accessibilityTraits;
accessibilityElement.accessibilityLabel = self.accessibilityLabel;
ASUpdateAccessibilityFrame(accessibilityElement, layout, containerNode, self);
[accessibilityElements addObject:accessibilityElement];
Expand Down
2 changes: 1 addition & 1 deletion Source/Details/_ASDisplayViewAccessiblity.mm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static void CollectAccessibilityElements(ASDisplayNode *node, NSMutableArray *el
[elements addObject:subnode.view];
}
} else if (subnode.isLayerBacked) {
// Go down the hierarchy for layer backed subnodes which are also accessibility containe
// Go down the hierarchy for layer backed subnodes which are also accessibility container
// and collect all of the UIAccessibilityElement
CollectAccessibilityElementsForLayerBackedOrRasterizedNode(node, subnode, elements);
} else if (subnode.accessibilityElementCount > 0) {
Expand Down

0 comments on commit 6e36749

Please sign in to comment.