-
Notifications
You must be signed in to change notification settings - Fork 28.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[a11y] fixes overlayPortals not showing VoiceControl labels #164754
Conversation
@@ -790,7 +790,6 @@ - (BOOL)accessibilityRespondsToUserInteraction { | |||
if (!self.node.customAccessibilityActions.empty()) { | |||
return true; | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the formatter did this
// Find the min rect containing the children, and set the accessibilityFrame to that. | ||
NSArray<SemanticsObject*>* children = self.semanticsObject.children; | ||
CGRect boundingRect = self.semanticsObject.accessibilityFrame; | ||
for (SemanticsObject* child in children) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may need to be careful about performance since a11yframe is called quite frequently. If we want to traverse the subtree we should have some sort of caching.
I remembered there was an idea to make this frame to always cover the screen. Is that still on the table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can also just make it always cover the screen. Im just not well versed about performance implications when it comes to a11y.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can say from experience this may be called multiple times on multiple UIAccessibility[s] in a single left or right swipe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I encountered some weirdness because i was using UIScreen.mainScreen
and someone mentioned it might act weird if theres a second screen, but I can revert to that approach too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you can use FlutterView's bound instead. but someone from iOS team should be able to confirm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i ended up using UIScreen.mainScreen after asking around. looks like the way we refer to screen bounds in most of the code base.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #157753
Even when a
uiaccessibilityelement
is marked asaccessibilityRespondsToUserInteraction
, if it's spatially far away enough from its parent'saccessibilityFrame
, a VoiceControl label will not be created for it. In this PR, I set the parentSemanticObjectContainer
'saccessibilityFrame
so it is the minimum rect that will cover all it's children.Pre-launch Checklist
///
).