This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
iOS accessibility ignore layout change if app is not active #32511
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
FlutterDartProject* project = [[FlutterDartProject alloc] init]; | ||
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"foobar" project:project]; | ||
[engine createShell:@"" libraryURI:@"" initialRoute:nil]; | ||
|
@@ -943,7 +943,7 @@ - (void)testHideA11yElements { | |
[[NSNotificationCenter defaultCenter] | ||
postNotificationName:UIApplicationWillResignActiveNotification | ||
object:nil]; | ||
XCTAssertTrue(realVC.view.accessibilityElementsHidden); | ||
XCTAssertFalse(realVC.view.accessibilityElementsHidden); | ||
[[NSNotificationCenter defaultCenter] | ||
postNotificationName:UIApplicationDidBecomeActiveNotification | ||
object:nil]; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -200,8 +200,8 @@ void PostAccessibilityNotification(UIAccessibilityNotifications notification, | |
for (SemanticsObject* object in [objects_ allValues]) { | ||
[object accessibilityBridgeDidFinishUpdate]; | ||
} | ||
|
||
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 commentThe 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 |
||
layoutChanged = layoutChanged || [doomed_uids count] > 0; | ||
|
||
if (routeChanged) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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