-
Notifications
You must be signed in to change notification settings - Fork 28.5k
Add optional flag to determine assertiveness level in aria announcement for flutter web #107568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nts for flutter web
final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection); | ||
/// | ||
/// The assertiveness level of the announcement can be determined by setting [assertivenessSetting]. | ||
/// Currently, this is only supported by the web engine and has no effect on other platforms. |
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.
What do you get on other platforms? Always assertive? Always polite? Is it platform dependent?
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.
According to @chunhtai's comment above:
Android does not have such setting, it will always interrupt. iOS has two different politeness, always gets interrupted or queue after current announcement.
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.
static Future<void> announce(String message, TextDirection textDirection) async { | ||
final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection); | ||
/// | ||
/// The assertiveness level of the announcement can be determined by [assertiveness]. |
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.
nit: I'd replace "can be" with "is"
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 paragraph does not add any more information other than the parameter name.
Maybe mention why developer would want to use this parameter? maybe give an example situation and which enum value you can use?
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
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, left some minor comments on doc string
/// Determines whether the announcement should interrupt any existing announcement, | ||
/// or queue after it. | ||
/// | ||
/// On the web this option uses the aria-live level to set the assertiveness |
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 will probably remove anything related to aria-live in the doc string. It is an implementation detail and will probably confuse reader
static Future<void> announce(String message, TextDirection textDirection) async { | ||
final AnnounceSemanticsEvent event = AnnounceSemanticsEvent(message, textDirection); | ||
/// | ||
/// The assertiveness level of the announcement can be determined by [assertiveness]. |
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 paragraph does not add any more information other than the parameter name.
Maybe mention why developer would want to use this parameter? maybe give an example situation and which enum value you can use?
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nouncement for flutter web (flutter/flutter#107568)
…nt for flutter web (flutter#107568)
Add an optional flag to Flutter's accessibility announcer service to support two different modes of aria announcements in flutter web. Developers can make the announcement
assertive
orpolite
using this flag. The change on the web engine side is tracked here: flutter/engine#34640Fixes #104109
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.