-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[iOS][A11Y] fix hittest with non-SemanticsObject #44014
Conversation
@@ -573,7 +578,13 @@ - (SemanticsObject*)search:(CGPoint)point { | |||
// IOS 16. Overrides this method to focus the first eligiable semantics | |||
// object in hit test order. | |||
- (id)_accessibilityHitTest:(CGPoint)point withEvent:(UIEvent*)event { | |||
return [self search:point]; | |||
id hittest = [self search:point]; | |||
if (hittest != self) { |
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.
can we just check if hittest is a semanticObject here?
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.
sure. done
8898a31
to
8a1fb47
Compare
if (![hittest isKindOfClass:[SemanticsObject class]]) { | ||
// If hittest result is not a SemanticsObject (e.g. PlatformView), | ||
// call the default hittest method to find the hittest result inside the "hittest". | ||
return [(NSObject*)hittest _accessibilityHitTest:point withEvent:event]; |
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.
This is not viable, unfortunately.
If we can't implement this method without needing to make a call like this, we'll need to remove the method entirely and find a different workaround for the initial problem it was added to address.
8a1fb47
to
c1d3fd0
Compare
@stuartmorgan I overthought the problem. The fix is actually a lot simpler than what I had. PTAL |
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.
Nice! LGTM
…131790) flutter/engine@d6b962d...9304c00 2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from d29f946d6180 to 01ee134bb223 (1 revision) (flutter/engine#44269) 2023-08-02 ychris@google.com [iOS][A11Y] fix hittest with non-SemanticsObject (flutter/engine#44014) 2023-08-02 skia-flutter-autoroll@skia.org Roll ANGLE from d61a50c155bd to d29f946d6180 (1 revision) (flutter/engine#44267) 2023-08-02 skia-flutter-autoroll@skia.org Roll Skia from 6009cc6d7d80 to 514c66ce0471 (2 revisions) (flutter/engine#44268) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC jacksongardner@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
PlatformViewSemanticsContainer did not implement the nativeAccessibility method, leads to a nil object being returned. Fixes flutter/flutter#131014 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Cherry-pick #44014 Fixes flutter/flutter#131885 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
PlatformViewSemanticsContainer did not implement the nativeAccessibility method, leads to a nil object being returned. Fixes flutter/flutter#131014 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
PlatformViewSemanticsContainer did not implement the nativeAccessibility method, leads to a nil object being returned.
Fixes flutter/flutter#131014
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.