-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add live region semantics flag #5512
Conversation
lib/ui/semantics.dart
Outdated
@@ -366,6 +367,18 @@ class SemanticsFlag { | |||
/// used to implement accessibility scrolling on iOS. | |||
static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex); | |||
|
|||
/// Whether the semantics node represents a region with important screen updates |
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: full stop at end?
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.
Fixed
lib/ui/semantics.dart
Outdated
@@ -366,6 +367,18 @@ class SemanticsFlag { | |||
/// used to implement accessibility scrolling on iOS. | |||
static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex); | |||
|
|||
/// Whether the semantics node represents a region with important screen updates | |||
/// | |||
/// A [SnackBar] is an example of usecase for a live region. Since they are usually |
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.
remove "of"?
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.
Fixed
// It is very important that this is added to mLiveRegions before sending the accessibility event | ||
// below. | ||
mLiveRegions.put(object.id, labelHint); | ||
if (priorLabelHint == null || !priorLabelHint.equals(labelHint)) { |
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 a little surprised to see this get send here and not in updateSemantics with the other events. This means, we only send the event if Android actually happens to ask us for the semantics of a particular node, which might not be guaranteed?
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 agree that this is odd. In my experiments I found that (at least on a pixel) no notifications are produced if this event is sent before the framework calls this method. during seems to be no problem
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.
Did some more investigation and found that there was another error that was masking this. Fixed and moved to a better location
@@ -366,6 +367,21 @@ class SemanticsFlag { | |||
/// used to implement accessibility scrolling on iOS. | |||
static const SemanticsFlag isHidden = const SemanticsFlag._(_kIsHiddenIndex); | |||
|
|||
/// Whether the semantics node is a live region. | |||
/// | |||
/// A live region indicates that this semantics node will update its |
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 sounds misleading to me. Any semantics node may update its semantics label without being a liveRegion, no? liveRegion just tells a11y systems that a it may be relevant to inform the user about a changed label, no?
Closing in favor of #5601, where I have addressed comments |
Discussion: flutter/flutter#18414