Skip to content

Conversation

@hannah-hyj
Copy link
Member

@hannah-hyj hannah-hyj commented May 5, 2023

issue: #94523
engine pr: flutter/engine#41777

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) framework flutter/packages/flutter repository. See also f: labels. labels May 5, 2023
@chunhtai chunhtai self-requested a review May 10, 2023 15:38
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe give some example on when this should be used and when not.

For example, this should be used if the current focus rendering object is removed and replace with another rendering object. Such design should avoid if possible. but in case this is needed, then it is a reasonable use case for this API.

Some example that is not recommended is that when a new popup or dropdown opens, moving the focus in these cases may confuse user and make it less accessible.

Copy link
Member Author

Choose a reason for hiding this comment

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

Some example that is not recommended is that when a new popup or dropdown opens>>
#115808 For example this issue is to open a new bottom sheet and the a11y focus is not consistent. I think developers still want to change focus in such cases?

Copy link
Contributor

Choose a reason for hiding this comment

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

For inconsistent jump, I think this something that should be fixed on our side.

@hannah-hyj hannah-hyj requested a review from chunhtai May 16, 2023 18:06
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

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

LGTM, should probably wait for engine to be merged first.

Also have you figure out how to handle TextField?

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe

The currently focused rendering object is replaced by another rendering object. In general, such design should be avoided if possible. If not, one may want to refocus the newly added rendering object

@chunhtai chunhtai requested a review from goderbauer May 16, 2023 18:37
Copy link
Member

Choose a reason for hiding this comment

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

It's not clear to me what the "consistency of the accessibility focus" is. This makes it sound like you may not be able to move focus anymore after using this? Which hopefully, is not the case. What do you actually mean by consistency? Maybe, that it may break a users' expectation of how a11y focus works and therefore should be just very carefully?

Copy link
Member Author

Choose a reason for hiding this comment

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

This makes it sound like you may not be able to move focus anymore after using this?>> No that's not the case.

It may break a users' expectation of how a11y focus works and therefore should be just very carefully? >> Yes this way to describe is more accurate.

Copy link
Member

Choose a reason for hiding this comment

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

Questions I have here that probably should be answered by the doc: What if the renderObject doesn't own a semantics node? Where does focus go?

Copy link
Member Author

@hannah-hyj hannah-hyj May 31, 2023

Choose a reason for hiding this comment

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

sendSemanticsEvent will look up for the first parent render object with a non-null semantic node.

And it doesn't work for the textField, so I am thinking about overriding textField 's sendSemanticsEvent as a workaround, do you think it's acceptable?

And do you know some other cases like the textField?

@goderbauer
Copy link
Member

Looks like some checks are failing?

@github-actions github-actions bot removed framework flutter/packages/flutter repository. See also f: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) labels May 31, 2023
/// object. In general, such design should be avoided if possible. If not, one may want
/// to refocus the newly added rendering object.
///
/// One example that are not recommended:
Copy link
Member

Choose a reason for hiding this comment

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

are->is

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

@goderbauer
Copy link
Member

The analyzer seems to be unhappy, though.

@hannah-hyj hannah-hyj added the autosubmit Merge PR when tree becomes green via auto submit App label May 31, 2023
@auto-submit auto-submit bot merged commit a829b57 into flutter:master May 31, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jun 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 17, 2023
@rifkyputra
Copy link

ah, you saved my life, thank you for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants