Skip to content

Conversation

@chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Jun 12, 2020

Description

This will change the order that semantics focus traverse.

Related Issues

Fixes #46625

Tests

I added the following tests:

TBD, will add test once we are ok with this approach.

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 Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • 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.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Jun 12, 2020
@fluttergithubbot
Copy link
Contributor

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@chunhtai
Copy link
Contributor Author

@goderbauer would you take a look at this pr? I don't have test yet since i would like to have some feedback if this the approach we want to take.

Copy link
Member

@goderbauer goderbauer Jun 12, 2020

Choose a reason for hiding this comment

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

Will this mess up hit testing on e.g. Android? I would expect that on Android whenever you try to touch anything in the alert to a11y focus it, you’ll actually focus the modal barrier now...

@goderbauer
Copy link
Member

Can you use sortKey wrapped around the barrier and the modal scope to achieve the same affect in a simpler way (and without potentially messing up hittest order?

https://api.flutter.dev/flutter/semantics/SemanticsProperties/sortKey.html

@chunhtai chunhtai force-pushed the issues/46625 branch 2 times, most recently from 798e49a to 8b469a8 Compare June 12, 2020 20:17
@chunhtai
Copy link
Contributor Author

chunhtai commented Jun 12, 2020

Hi @goderbauer I used the sort key, and it seemed to be a cleaner way to solve this problem. This however, broke a lot of semantics test because we add a new semantics node above each modal route. Before I proceed to fix all the failing tests, do you think this is the approach we want to take?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

Using sortKey is the right fix for this (can you verify on real devices (Android and iOS) that this all works as expected?).

This will probably also break tests internally in google. We'll have to come up with a migration path.

Copy link
Member

Choose a reason for hiding this comment

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

nit: revert formatting change?

Copy link
Member

Choose a reason for hiding this comment

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

nit: remove this empty line?

@chunhtai
Copy link
Contributor Author

@goderbauer can you take another look at this?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM after comments are resolved.

We really need to find a better way to write semantics tests to make them less brittle. This change shouldn't really require so many unrelated test changes...

Copy link
Member

Choose a reason for hiding this comment

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

Should this be semanticsDismissible instead of barrierDismissible?

Copy link
Contributor Author

@chunhtai chunhtai Jun 23, 2020

Choose a reason for hiding this comment

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

nice catch, actually it should check both. the semanticsDismissible name is confusing, it means the semantics should include this modal barrier, barrierDismissible is the actual one whether the barrier is selectable. If the barrierDismissible = false and semanticsDismissible = true, the barrier is still excluded from the semantics tress.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment here: // To be sorted after the _ModalScope.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment here: // To be sorted before the ModalBarrier

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: "// Regression test for ."

Comment on lines +1259 to +1263
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't the barrier have a label and/or action we can use to identify it better? This could just be any stray semantics node...

@chunhtai chunhtai merged commit 5623fea into flutter:master Jun 24, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
…#59290)

* Add semantics sort key for modal scope and modal barrier

* fix test

* fix test

* fix test

* fix space

* fix more tests

* addressing comments
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A11y initial focus on "dismiss barrier" when showing a dismissable AlertDialog

4 participants