Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

fix ios layout change cause the accessibility focus to jump randomly. #20167

Merged
merged 3 commits into from
Aug 5, 2020

Conversation

chunhtai
Copy link
Contributor

Description

We always passes nil to layoutchange announcement and scroll announcement, this make ios to decide what to focus next by itself, and the result is unpredictable.

This pr makes accessibility bridge in ios to cache the last focused semantics object and attempt to refocus the same id after layout change or scroll to prevent a sudden jump in accessibility focus.

This is corresponding to the second problem i mentioned in flutter/flutter#62549 (comment)

Related Issues

flutter/flutter#62549

Tests

I added the following tests:

See files

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the contributor guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the C++, Objective-C, Java style guides for the engine.
  • I read the tree hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation.
  • All existing and new tests are passing.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read handling breaking changes.

@chunhtai
Copy link
Contributor Author

chunhtai commented Aug 3, 2020

a friendly bump

@chunhtai chunhtai requested a review from blasten August 4, 2020 16:22
@@ -24,6 +24,7 @@ class AccessibilityBridgeIos {
virtual void DispatchSemanticsAction(int32_t id,
flutter::SemanticsAction action,
std::vector<uint8_t> args) = 0;
virtual void AccessibilityFocusDidChange(int32_t focused_id) = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a docstring, what focused_id is could be misinterpreted (it could mean the old value).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants