-
Notifications
You must be signed in to change notification settings - Fork 6k
iOS accessibility ignore layout change if app is not active #32511
Conversation
@gaaclarke may be familiar with this |
test fix typo
|
||
if (!ios_delegate_->IsFlutterViewControllerPresentingModalViewController(view_controller_)) { | ||
if (!ios_delegate_->IsFlutterViewControllerPresentingModalViewController(view_controller_) && | ||
[UIApplication sharedApplication].applicationState == UIApplicationStateActive) { |
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 had a typo here that made it "worked". Looks like with a popup on the screen, the state is still active, so [UIApplication sharedApplication].applicationState
should not be used as an indicator here. Will need to find another way to do it. Setting this PR to draft until I fix it
@@ -817,7 +817,6 @@ - (void)dealloc { | |||
|
|||
- (void)applicationBecameActive:(NSNotification*)notification { | |||
TRACE_EVENT0("flutter", "applicationBecameActive"); | |||
self.view.accessibilityElementsHidden = NO; |
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 am confused at the change, it seems like the a11y was hidden when the view is not active prior to this change. and this change makes it so it does not hide the a11y when the view is not active?
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 code was a workaround to fix the same issue that this PR is trying to fix. Since we found the root cause and potentially a fix with this PR; we can remove the old workaround.
The workaround was introduced in 0be0303
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. |
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, this is a draft let me know if you want me to approve it. It's got tests and makes sense to me.
@@ -932,7 +932,7 @@ - (void)testHideOverlay { | |||
engine.viewController = nil; | |||
} | |||
|
|||
- (void)testHideA11yElements { | |||
- (void)testDoNotHideA11yElements { |
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.
Maybe we should just rip out this test now that we are undoing the work that caused it.
@gaaclarke surprisedly the application state is active while there's a popup, so the fix actually didn't work. (Doesn't make sense to me) I'm trying to see if there is a way to detect the application state more accurately. |
So the application state is actually updated after |
This solution won't work as the accessibility update is fired before we know the app is going to be resigned active. I have provided a less satisfying fix so that we can turn the tests back on: #32820 |
When the app is not active, make the accessibility bridge ignore layout changes, which leads to refocus a11y to an item on the inactive app.
Fixes: flutter/flutter#93030
flutter/flutter#93504
Pre-launch Checklist
writing and running engine tests.
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.