-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[Accessibility] Add required semantics flags #164585
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
bf897e0 to
c7fa33d
Compare
chunhtai
left a comment
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.
mostly lgtm, left a question
| void update() { | ||
| if (semanticsObject.isFlagsDirty) { | ||
| if (semanticsObject.isRequirable) { | ||
| owner.setAttribute('aria-required', semanticsObject.isRequired); |
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.
We may need to double check for roles that create additional dom element such as text_field, I think this will add aria-required to the wrapper div instead of the input tag
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.
Good catch. It looks like neither the input tag nor its wrapper div have the aria-required attribute, even though the Flutter semantics tree has isRequired. I'll investigate and add a test for this scenario!
Repro...
App:
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';
void main() {
runApp(
MaterialApp(
home: Scaffold(
body: Semantics(required: true, child: TextField()),
),
),
);
SemanticsBinding.instance.ensureSemantics();
}Semantics tree:
SemanticsNode#0
│ Rect.fromLTRB(0.0, 0.0, 2400.0, 1604.0)
│
└─SemanticsNode#1
│ Rect.fromLTRB(0.0, 0.0, 1200.0, 802.0) scaled by 2.0x
│ textDirection: ltr
│
└─SemanticsNode#2
│ Rect.fromLTRB(0.0, 0.0, 1200.0, 802.0)
│ sortKey: OrdinalSortKey#cda74(order: 0.0)
│
└─SemanticsNode#3
│ Rect.fromLTRB(0.0, 0.0, 1200.0, 802.0)
│ flags: scopesRoute
│
└─SemanticsNode#4
Rect.fromLTRB(0.0, 0.0, 1200.0, 48.0)
actions: didGainAccessibilityFocus, didLoseAccessibilityFocus,
focus, tap
flags: isTextField, hasEnabledState, isEnabled, hasRequiredState,
isRequired
textDirection: ltr
text selection: [0, 0]
currentValueLength: 0
HTML generated by Flutter Web:
<flutter-view flt-view-id="0" tabindex="0" style="...">
<flt-semantics-host style="...">
<flt-semantics id="flt-semantic-node-0"
style="...">
<flt-semantics-container style="...">
<flt-semantics id="flt-semantic-node-1"
style="...">
<flt-semantics-container style="...">
<flt-semantics id="flt-semantic-node-2"
style="...">
<flt-semantics-container style="...">
<flt-semantics id="flt-semantic-node-3" role="dialog"
style="...">
<flt-semantics-container style="...">
<flt-semantics id="flt-semantic-node-4"
style="...">
<input type="text" spellcheck="false" autocorrect="on" autocomplete="on"
data-semantics-role="text-field"
style="...">
</flt-semantics>
</flt-semantics-container>
</flt-semantics>
</flt-semantics-container>
</flt-semantics>
</flt-semantics-container>
</flt-semantics>
</flt-semantics-container>
</flt-semantics>
</flt-semantics-host>
</flutter-view>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.
Yeah, the responsibility for applying aria-required probably belongs in SemanticRole implementation classes: SemanticCheckable, SemanticIncrementable, SemanticTextField. Maybe also radiogroup? Not every role supports this.
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.
If it is not even on the div, it is probably that the semanticsRole doesn't use basic super constructor. You will need to manually add the behavior to those classes
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 verified the following:
SemanticsCheckable- works as expectedSemanticIncrementable- Do we have an incrementable control with optional values? The MaterialSlider.valueis non-nullable, you cannot have aSliderwithout a value.SemanticsTextField- fixed!
I believe this is addressed, but please let me know if you have follow-up concerns!
26e3e08 to
7893e01
Compare
| } | ||
|
|
||
| void addRequirableBehavior() { | ||
| addSemanticBehavior(Requirable(semanticsObject, this)); |
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.
For performance, can we add the behavior only if semanticsObject.isRequirable is true? Or do we expect that the value of isRequirable may change during the lifetime of a node? According to SemanticsConfiguration below, once isRequired is set, the node becomes requirable forever.
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.
For performance, can we add the behavior only if
semanticsObject.isRequirableis true? Or do we expect that the value ofisRequirablemay change during the lifetime of a node?
I expect the value of isRequirable can change during the lifetime of a node. For example, imagine I have a form that has a shipping address, a billing address, and a checkbox to use the shipping address as the billing address. If I uncheck the checkbox, the billing address becomes required.
According to
SemanticsConfigurationbelow, onceisRequiredis set, the node becomes requirable forever.
That's correct. However, when a render object's semantics needs to update, the SemanticsConfiguration is thrown away and a new one is created:
flutter/packages/flutter/lib/src/rendering/object.dart
Lines 5528 to 5537 in c38f0b7
| void markNeedsUpdate() { | |
| final SemanticsNode? producedSemanticsNode = cachedSemanticsNode; | |
| // Dirty the semantics tree starting at `this` until we have reached a | |
| // RenderObject that is a semantics boundary. All semantics past this | |
| // RenderObject are still up-to date. Therefore, we will later only rebuild | |
| // the semantics subtree starting at the identified semantics boundary. | |
| final bool wasSemanticsBoundary = | |
| producedSemanticsNode != null && configProvider.wasSemanticsBoundary; | |
| configProvider.clear(); |
flutter/packages/flutter/lib/src/rendering/object.dart
Lines 4679 to 4683 in c38f0b7
| void clear() { | |
| _isEffectiveConfigWritable = false; | |
| _effectiveConfiguration = null; | |
| _originalConfiguration = null; | |
| } |
flutter/packages/flutter/lib/src/rendering/object.dart
Lines 4631 to 4648 in c38f0b7
| /// The original config without any change through [updateConfig]. | |
| /// | |
| /// This is typically use to recalculate certain properties when mutating | |
| /// [effective] since [effective] may contain stale data from previous update. | |
| /// Examples are [SemanticsConfiguration.isBlockingUserActions] or | |
| /// [SemanticsConfiguration.elevation]. Otherwise, use [effective] instead. | |
| SemanticsConfiguration get original { | |
| if (_originalConfiguration == null) { | |
| _effectiveConfiguration = _originalConfiguration = SemanticsConfiguration(); | |
| _renderObject.describeSemanticsConfiguration(_originalConfiguration!); | |
| assert( | |
| !_originalConfiguration!.explicitChildNodes || | |
| _originalConfiguration!.childConfigurationsDelegate == null, | |
| 'A SemanticsConfiguration with explicitChildNode set to true cannot have a non-null childConfigsDelegate.', | |
| ); | |
| } | |
| return _originalConfiguration!; | |
| } |
SemanticsConfiguration mutation is used when its parent needs to update some information:
flutter/packages/flutter/lib/src/rendering/object.dart
Lines 4605 to 4608 in c38f0b7
| /// In some cases during [PipelineOwner.flushSemantics], the config has to be | |
| /// mutated due to [_SemanticsParentData] update to propagate updated property | |
| /// to semantics node. One should use [updateConfig] to update the config in this | |
| /// case. |
chunhtai
left a comment
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, once all comments are addressed
7893e01 to
53df1e3
Compare
Manual roll Flutter from b16430b to 1d954f4 (114 revisions) Manual roll requested by [email protected] flutter/flutter@b16430b...1d954f4 2025-03-17 [email protected] Revert "[skwasm] Dynamic Threading (#164748)" (flutter/flutter#165350) 2025-03-17 [email protected] Roll Skia from fa669e2e6d12 to 52130e5c3b34 (4 revisions) (flutter/flutter#165348) 2025-03-17 [email protected] `OverlayPortal.childLayoutBuilder` should rebuild when `OverlayPortal` rebuilds. (flutter/flutter#165331) 2025-03-17 [email protected] [web][a11y]Delete _childContainerElement (flutter/flutter#163662) 2025-03-17 [email protected] Roll Skia from e45207898e60 to fa669e2e6d12 (8 revisions) (flutter/flutter#165342) 2025-03-17 [email protected] Add documentation for Java test filtering to plugins test document (flutter/flutter#165314) 2025-03-17 [email protected] Roll Fuchsia Linux SDK from SDNQgVXxHbbd0qsVw... to mPniqXmPpXqMMpM8z... (flutter/flutter#165313) 2025-03-17 [email protected] Roll Dart SDK from 9283d47199b7 to 725172afbc42 (1 revision) (flutter/flutter#165310) 2025-03-17 [email protected] feat(Tooltip): replace the height parameter with constraints (flutter/flutter#163314) 2025-03-17 [email protected] Fix arrowHeadColor breaks differentiation between states (flutter/flutter#165178) 2025-03-17 [email protected] Removes assumption that basis scalar and rounded_scalar match (flutter/flutter#165166) 2025-03-17 [email protected] Roll Skia from 69cf4c2c5db8 to e45207898e60 (1 revision) (flutter/flutter#165300) 2025-03-17 [email protected] Refactor: Move sliders value indicator shape to seperate file (flutter/flutter#162858) 2025-03-17 [email protected] Roll Skia from 3931c31032c7 to 69cf4c2c5db8 (1 revision) (flutter/flutter#165288) 2025-03-17 [email protected] Delete `docs/infra/Infra-Ticket-Queue.md` (flutter/flutter#165258) 2025-03-16 [email protected] Roll Skia from 3413a02d6fc8 to 3931c31032c7 (1 revision) (flutter/flutter#165277) 2025-03-16 [email protected] Roll Fuchsia Linux SDK from LPz5j18JDsms41r3T... to SDNQgVXxHbbd0qsVw... (flutter/flutter#165275) 2025-03-16 [email protected] Roll Dart SDK from 067560bcd521 to 9283d47199b7 (1 revision) (flutter/flutter#165269) 2025-03-16 [email protected] Roll Skia from f124daeb564d to 3413a02d6fc8 (1 revision) (flutter/flutter#165263) 2025-03-15 [email protected] Roll Dart SDK from 40bb66a945e4 to 067560bcd521 (1 revision) (flutter/flutter#165262) 2025-03-15 [email protected] Roll Fuchsia Linux SDK from efdpJgW4DIV6j1mO1... to LPz5j18JDsms41r3T... (flutter/flutter#165252) 2025-03-15 [email protected] Roll Dart SDK from f23d496f0585 to 40bb66a945e4 (1 revision) (flutter/flutter#165250) 2025-03-15 [email protected] Roll Dart SDK from 8814749ec6a4 to f23d496f0585 (1 revision) (flutter/flutter#165246) 2025-03-15 [email protected] Roll Skia from 4568e766ed0a to f124daeb564d (1 revision) (flutter/flutter#165245) 2025-03-15 [email protected] Revert "Prevent explicit roles from merging (#164732)" (flutter/flutter#165222) 2025-03-15 [email protected] Roll Skia from bac6e76abfc7 to 4568e766ed0a (5 revisions) (flutter/flutter#165241) 2025-03-14 [email protected] Roll Dart SDK from a51f1bfa0f6a to 8814749ec6a4 (2 revisions) (flutter/flutter#165227) 2025-03-14 [email protected] Roll Skia from 98b6922deecf to bac6e76abfc7 (5 revisions) (flutter/flutter#165225) 2025-03-14 [email protected] Point ktlint AS docs to the `.editorconfig` that is actually used by ci, instead of making a copy in the README (flutter/flutter#165213) 2025-03-14 [email protected] Add remaining dart fixes for Color deprecations when importing painting.dart (flutter/flutter#162609) 2025-03-14 [email protected] [Accessibility] Add required semantics flags (flutter/flutter#164585) 2025-03-14 [email protected] Roll Skia from f4467ff38f1f to 98b6922deecf (5 revisions) (flutter/flutter#165215) 2025-03-14 [email protected] Convert `BaseFlutterTask` From Groovy to Kotlin (flutter/flutter#163148) 2025-03-14 [email protected] `OverlayPortal.overlayChildLayoutBuilder` (flutter/flutter#164034) 2025-03-14 [email protected] Remove redundant `useMaterial3: true` (flutter/flutter#163376) 2025-03-14 [email protected] Roll Packages from 9cc6f37 to ff7724c (1 revision) (flutter/flutter#165197) 2025-03-14 [email protected] Changelog updates from 3.29.2 (flutter/flutter#165194) 2025-03-14 [email protected] Roll Dart SDK from 576514b2bfce to a51f1bfa0f6a (1 revision) (flutter/flutter#165191) 2025-03-14 [email protected] Roll Dart SDK from ceb58442306e to 576514b2bfce (2 revisions) (flutter/flutter#165180) 2025-03-14 [email protected] Roll Fuchsia Linux SDK from qXOLczyRJadxMW0PK... to efdpJgW4DIV6j1mO1... (flutter/flutter#165175) 2025-03-14 [email protected] [Impeller] Enable mediatek on API 34+. (flutter/flutter#165156) 2025-03-14 [email protected] Roll Dart SDK from cd06d4ba4fec to ceb58442306e (5 revisions) (flutter/flutter#165159) 2025-03-13 [email protected] [FGP conversion] Port `FlutterExtension` from Groovy to Kotlin (flutter/flutter#165143) 2025-03-13 [email protected] Prevent explicit roles from merging (flutter/flutter#164732) ...
…8922) Manual roll Flutter from b16430b to 1d954f4 (114 revisions) Manual roll requested by [email protected] flutter/flutter@b16430b...1d954f4 2025-03-17 [email protected] Revert "[skwasm] Dynamic Threading (#164748)" (flutter/flutter#165350) 2025-03-17 [email protected] Roll Skia from fa669e2e6d12 to 52130e5c3b34 (4 revisions) (flutter/flutter#165348) 2025-03-17 [email protected] `OverlayPortal.childLayoutBuilder` should rebuild when `OverlayPortal` rebuilds. (flutter/flutter#165331) 2025-03-17 [email protected] [web][a11y]Delete _childContainerElement (flutter/flutter#163662) 2025-03-17 [email protected] Roll Skia from e45207898e60 to fa669e2e6d12 (8 revisions) (flutter/flutter#165342) 2025-03-17 [email protected] Add documentation for Java test filtering to plugins test document (flutter/flutter#165314) 2025-03-17 [email protected] Roll Fuchsia Linux SDK from SDNQgVXxHbbd0qsVw... to mPniqXmPpXqMMpM8z... (flutter/flutter#165313) 2025-03-17 [email protected] Roll Dart SDK from 9283d47199b7 to 725172afbc42 (1 revision) (flutter/flutter#165310) 2025-03-17 [email protected] feat(Tooltip): replace the height parameter with constraints (flutter/flutter#163314) 2025-03-17 [email protected] Fix arrowHeadColor breaks differentiation between states (flutter/flutter#165178) 2025-03-17 [email protected] Removes assumption that basis scalar and rounded_scalar match (flutter/flutter#165166) 2025-03-17 [email protected] Roll Skia from 69cf4c2c5db8 to e45207898e60 (1 revision) (flutter/flutter#165300) 2025-03-17 [email protected] Refactor: Move sliders value indicator shape to seperate file (flutter/flutter#162858) 2025-03-17 [email protected] Roll Skia from 3931c31032c7 to 69cf4c2c5db8 (1 revision) (flutter/flutter#165288) 2025-03-17 [email protected] Delete `docs/infra/Infra-Ticket-Queue.md` (flutter/flutter#165258) 2025-03-16 [email protected] Roll Skia from 3413a02d6fc8 to 3931c31032c7 (1 revision) (flutter/flutter#165277) 2025-03-16 [email protected] Roll Fuchsia Linux SDK from LPz5j18JDsms41r3T... to SDNQgVXxHbbd0qsVw... (flutter/flutter#165275) 2025-03-16 [email protected] Roll Dart SDK from 067560bcd521 to 9283d47199b7 (1 revision) (flutter/flutter#165269) 2025-03-16 [email protected] Roll Skia from f124daeb564d to 3413a02d6fc8 (1 revision) (flutter/flutter#165263) 2025-03-15 [email protected] Roll Dart SDK from 40bb66a945e4 to 067560bcd521 (1 revision) (flutter/flutter#165262) 2025-03-15 [email protected] Roll Fuchsia Linux SDK from efdpJgW4DIV6j1mO1... to LPz5j18JDsms41r3T... (flutter/flutter#165252) 2025-03-15 [email protected] Roll Dart SDK from f23d496f0585 to 40bb66a945e4 (1 revision) (flutter/flutter#165250) 2025-03-15 [email protected] Roll Dart SDK from 8814749ec6a4 to f23d496f0585 (1 revision) (flutter/flutter#165246) 2025-03-15 [email protected] Roll Skia from 4568e766ed0a to f124daeb564d (1 revision) (flutter/flutter#165245) 2025-03-15 [email protected] Revert "Prevent explicit roles from merging (#164732)" (flutter/flutter#165222) 2025-03-15 [email protected] Roll Skia from bac6e76abfc7 to 4568e766ed0a (5 revisions) (flutter/flutter#165241) 2025-03-14 [email protected] Roll Dart SDK from a51f1bfa0f6a to 8814749ec6a4 (2 revisions) (flutter/flutter#165227) 2025-03-14 [email protected] Roll Skia from 98b6922deecf to bac6e76abfc7 (5 revisions) (flutter/flutter#165225) 2025-03-14 [email protected] Point ktlint AS docs to the `.editorconfig` that is actually used by ci, instead of making a copy in the README (flutter/flutter#165213) 2025-03-14 [email protected] Add remaining dart fixes for Color deprecations when importing painting.dart (flutter/flutter#162609) 2025-03-14 [email protected] [Accessibility] Add required semantics flags (flutter/flutter#164585) 2025-03-14 [email protected] Roll Skia from f4467ff38f1f to 98b6922deecf (5 revisions) (flutter/flutter#165215) 2025-03-14 [email protected] Convert `BaseFlutterTask` From Groovy to Kotlin (flutter/flutter#163148) 2025-03-14 [email protected] `OverlayPortal.overlayChildLayoutBuilder` (flutter/flutter#164034) 2025-03-14 [email protected] Remove redundant `useMaterial3: true` (flutter/flutter#163376) 2025-03-14 [email protected] Roll Packages from 9cc6f37 to ff7724c (1 revision) (flutter/flutter#165197) 2025-03-14 [email protected] Changelog updates from 3.29.2 (flutter/flutter#165194) 2025-03-14 [email protected] Roll Dart SDK from 576514b2bfce to a51f1bfa0f6a (1 revision) (flutter/flutter#165191) 2025-03-14 [email protected] Roll Dart SDK from ceb58442306e to 576514b2bfce (2 revisions) (flutter/flutter#165180) 2025-03-14 [email protected] Roll Fuchsia Linux SDK from qXOLczyRJadxMW0PK... to efdpJgW4DIV6j1mO1... (flutter/flutter#165175) 2025-03-14 [email protected] [Impeller] Enable mediatek on API 34+. (flutter/flutter#165156) 2025-03-14 [email protected] Roll Dart SDK from cd06d4ba4fec to ceb58442306e (5 revisions) (flutter/flutter#165159) 2025-03-13 [email protected] [FGP conversion] Port `FlutterExtension` from Groovy to Kotlin (flutter/flutter#165143) 2025-03-13 [email protected] Prevent explicit roles from merging (flutter/flutter#164732) ...
… (#8922) Manual roll Flutter from b16430b2fd57 to 1d954f4e96bd (114 revisions) Manual roll requested by [email protected] flutter/flutter@b16430b...1d954f4 2025-03-17 [email protected] Revert "[skwasm] Dynamic Threading (#164748)" (flutter/flutter#165350) 2025-03-17 [email protected] Roll Skia from fa669e2e6d12 to 52130e5c3b34 (4 revisions) (flutter/flutter#165348) 2025-03-17 [email protected] `OverlayPortal.childLayoutBuilder` should rebuild when `OverlayPortal` rebuilds. (flutter/flutter#165331) 2025-03-17 [email protected] [web][a11y]Delete _childContainerElement (flutter/flutter#163662) 2025-03-17 [email protected] Roll Skia from e45207898e60 to fa669e2e6d12 (8 revisions) (flutter/flutter#165342) 2025-03-17 [email protected] Add documentation for Java test filtering to plugins test document (flutter/flutter#165314) 2025-03-17 [email protected] Roll Fuchsia Linux SDK from SDNQgVXxHbbd0qsVw... to mPniqXmPpXqMMpM8z... (flutter/flutter#165313) 2025-03-17 [email protected] Roll Dart SDK from 9283d47199b7 to 725172afbc42 (1 revision) (flutter/flutter#165310) 2025-03-17 [email protected] feat(Tooltip): replace the height parameter with constraints (flutter/flutter#163314) 2025-03-17 [email protected] Fix arrowHeadColor breaks differentiation between states (flutter/flutter#165178) 2025-03-17 [email protected] Removes assumption that basis scalar and rounded_scalar match (flutter/flutter#165166) 2025-03-17 [email protected] Roll Skia from 69cf4c2c5db8 to e45207898e60 (1 revision) (flutter/flutter#165300) 2025-03-17 [email protected] Refactor: Move sliders value indicator shape to seperate file (flutter/flutter#162858) 2025-03-17 [email protected] Roll Skia from 3931c31032c7 to 69cf4c2c5db8 (1 revision) (flutter/flutter#165288) 2025-03-17 [email protected] Delete `docs/infra/Infra-Ticket-Queue.md` (flutter/flutter#165258) 2025-03-16 [email protected] Roll Skia from 3413a02d6fc8 to 3931c31032c7 (1 revision) (flutter/flutter#165277) 2025-03-16 [email protected] Roll Fuchsia Linux SDK from LPz5j18JDsms41r3T... to SDNQgVXxHbbd0qsVw... (flutter/flutter#165275) 2025-03-16 [email protected] Roll Dart SDK from 067560bcd521 to 9283d47199b7 (1 revision) (flutter/flutter#165269) 2025-03-16 [email protected] Roll Skia from f124daeb564d to 3413a02d6fc8 (1 revision) (flutter/flutter#165263) 2025-03-15 [email protected] Roll Dart SDK from 40bb66a945e4 to 067560bcd521 (1 revision) (flutter/flutter#165262) 2025-03-15 [email protected] Roll Fuchsia Linux SDK from efdpJgW4DIV6j1mO1... to LPz5j18JDsms41r3T... (flutter/flutter#165252) 2025-03-15 [email protected] Roll Dart SDK from f23d496f0585 to 40bb66a945e4 (1 revision) (flutter/flutter#165250) 2025-03-15 [email protected] Roll Dart SDK from 8814749ec6a4 to f23d496f0585 (1 revision) (flutter/flutter#165246) 2025-03-15 [email protected] Roll Skia from 4568e766ed0a to f124daeb564d (1 revision) (flutter/flutter#165245) 2025-03-15 [email protected] Revert "Prevent explicit roles from merging (#164732)" (flutter/flutter#165222) 2025-03-15 [email protected] Roll Skia from bac6e76abfc7 to 4568e766ed0a (5 revisions) (flutter/flutter#165241) 2025-03-14 [email protected] Roll Dart SDK from a51f1bfa0f6a to 8814749ec6a4 (2 revisions) (flutter/flutter#165227) 2025-03-14 [email protected] Roll Skia from 98b6922deecf to bac6e76abfc7 (5 revisions) (flutter/flutter#165225) 2025-03-14 [email protected] Point ktlint AS docs to the `.editorconfig` that is actually used by ci, instead of making a copy in the README (flutter/flutter#165213) 2025-03-14 [email protected] Add remaining dart fixes for Color deprecations when importing painting.dart (flutter/flutter#162609) 2025-03-14 [email protected] [Accessibility] Add required semantics flags (flutter/flutter#164585) 2025-03-14 [email protected] Roll Skia from f4467ff38f1f to 98b6922deecf (5 revisions) (flutter/flutter#165215) 2025-03-14 [email protected] Convert `BaseFlutterTask` From Groovy to Kotlin (flutter/flutter#163148) 2025-03-14 [email protected] `OverlayPortal.overlayChildLayoutBuilder` (flutter/flutter#164034) 2025-03-14 [email protected] Remove redundant `useMaterial3: true` (flutter/flutter#163376) 2025-03-14 [email protected] Roll Packages from bdb9c96 to d632936 (1 revision) (flutter/flutter#165197) 2025-03-14 [email protected] Changelog updates from 3.29.2 (flutter/flutter#165194) 2025-03-14 [email protected] Roll Dart SDK from 576514b2bfce to a51f1bfa0f6a (1 revision) (flutter/flutter#165191) 2025-03-14 [email protected] Roll Dart SDK from ceb58442306e to 576514b2bfce (2 revisions) (flutter/flutter#165180) 2025-03-14 [email protected] Roll Fuchsia Linux SDK from qXOLczyRJadxMW0PK... to efdpJgW4DIV6j1mO1... (flutter/flutter#165175) 2025-03-14 [email protected] [Impeller] Enable mediatek on API 34+. (flutter/flutter#165156) 2025-03-14 [email protected] Roll Dart SDK from cd06d4ba4fec to ceb58442306e (5 revisions) (flutter/flutter#165159) 2025-03-13 [email protected] [FGP conversion] Port `FlutterExtension` from Groovy to Kotlin (flutter/flutter#165143) 2025-03-13 [email protected] Prevent explicit roles from merging (flutter/flutter#164732) ...
…8922) Manual roll Flutter from b16430b to 1d954f4 (114 revisions) Manual roll requested by [email protected] flutter/flutter@b16430b...1d954f4 2025-03-17 [email protected] Revert "[skwasm] Dynamic Threading (#164748)" (flutter/flutter#165350) 2025-03-17 [email protected] Roll Skia from fa669e2e6d12 to 52130e5c3b34 (4 revisions) (flutter/flutter#165348) 2025-03-17 [email protected] `OverlayPortal.childLayoutBuilder` should rebuild when `OverlayPortal` rebuilds. (flutter/flutter#165331) 2025-03-17 [email protected] [web][a11y]Delete _childContainerElement (flutter/flutter#163662) 2025-03-17 [email protected] Roll Skia from e45207898e60 to fa669e2e6d12 (8 revisions) (flutter/flutter#165342) 2025-03-17 [email protected] Add documentation for Java test filtering to plugins test document (flutter/flutter#165314) 2025-03-17 [email protected] Roll Fuchsia Linux SDK from SDNQgVXxHbbd0qsVw... to mPniqXmPpXqMMpM8z... (flutter/flutter#165313) 2025-03-17 [email protected] Roll Dart SDK from 9283d47199b7 to 725172afbc42 (1 revision) (flutter/flutter#165310) 2025-03-17 [email protected] feat(Tooltip): replace the height parameter with constraints (flutter/flutter#163314) 2025-03-17 [email protected] Fix arrowHeadColor breaks differentiation between states (flutter/flutter#165178) 2025-03-17 [email protected] Removes assumption that basis scalar and rounded_scalar match (flutter/flutter#165166) 2025-03-17 [email protected] Roll Skia from 69cf4c2c5db8 to e45207898e60 (1 revision) (flutter/flutter#165300) 2025-03-17 [email protected] Refactor: Move sliders value indicator shape to seperate file (flutter/flutter#162858) 2025-03-17 [email protected] Roll Skia from 3931c31032c7 to 69cf4c2c5db8 (1 revision) (flutter/flutter#165288) 2025-03-17 [email protected] Delete `docs/infra/Infra-Ticket-Queue.md` (flutter/flutter#165258) 2025-03-16 [email protected] Roll Skia from 3413a02d6fc8 to 3931c31032c7 (1 revision) (flutter/flutter#165277) 2025-03-16 [email protected] Roll Fuchsia Linux SDK from LPz5j18JDsms41r3T... to SDNQgVXxHbbd0qsVw... (flutter/flutter#165275) 2025-03-16 [email protected] Roll Dart SDK from 067560bcd521 to 9283d47199b7 (1 revision) (flutter/flutter#165269) 2025-03-16 [email protected] Roll Skia from f124daeb564d to 3413a02d6fc8 (1 revision) (flutter/flutter#165263) 2025-03-15 [email protected] Roll Dart SDK from 40bb66a945e4 to 067560bcd521 (1 revision) (flutter/flutter#165262) 2025-03-15 [email protected] Roll Fuchsia Linux SDK from efdpJgW4DIV6j1mO1... to LPz5j18JDsms41r3T... (flutter/flutter#165252) 2025-03-15 [email protected] Roll Dart SDK from f23d496f0585 to 40bb66a945e4 (1 revision) (flutter/flutter#165250) 2025-03-15 [email protected] Roll Dart SDK from 8814749ec6a4 to f23d496f0585 (1 revision) (flutter/flutter#165246) 2025-03-15 [email protected] Roll Skia from 4568e766ed0a to f124daeb564d (1 revision) (flutter/flutter#165245) 2025-03-15 [email protected] Revert "Prevent explicit roles from merging (#164732)" (flutter/flutter#165222) 2025-03-15 [email protected] Roll Skia from bac6e76abfc7 to 4568e766ed0a (5 revisions) (flutter/flutter#165241) 2025-03-14 [email protected] Roll Dart SDK from a51f1bfa0f6a to 8814749ec6a4 (2 revisions) (flutter/flutter#165227) 2025-03-14 [email protected] Roll Skia from 98b6922deecf to bac6e76abfc7 (5 revisions) (flutter/flutter#165225) 2025-03-14 [email protected] Point ktlint AS docs to the `.editorconfig` that is actually used by ci, instead of making a copy in the README (flutter/flutter#165213) 2025-03-14 [email protected] Add remaining dart fixes for Color deprecations when importing painting.dart (flutter/flutter#162609) 2025-03-14 [email protected] [Accessibility] Add required semantics flags (flutter/flutter#164585) 2025-03-14 [email protected] Roll Skia from f4467ff38f1f to 98b6922deecf (5 revisions) (flutter/flutter#165215) 2025-03-14 [email protected] Convert `BaseFlutterTask` From Groovy to Kotlin (flutter/flutter#163148) 2025-03-14 [email protected] `OverlayPortal.overlayChildLayoutBuilder` (flutter/flutter#164034) 2025-03-14 [email protected] Remove redundant `useMaterial3: true` (flutter/flutter#163376) 2025-03-14 [email protected] Roll Packages from 9cc6f37 to ff7724c (1 revision) (flutter/flutter#165197) 2025-03-14 [email protected] Changelog updates from 3.29.2 (flutter/flutter#165194) 2025-03-14 [email protected] Roll Dart SDK from 576514b2bfce to a51f1bfa0f6a (1 revision) (flutter/flutter#165191) 2025-03-14 [email protected] Roll Dart SDK from ceb58442306e to 576514b2bfce (2 revisions) (flutter/flutter#165180) 2025-03-14 [email protected] Roll Fuchsia Linux SDK from qXOLczyRJadxMW0PK... to efdpJgW4DIV6j1mO1... (flutter/flutter#165175) 2025-03-14 [email protected] [Impeller] Enable mediatek on API 34+. (flutter/flutter#165156) 2025-03-14 [email protected] Roll Dart SDK from cd06d4ba4fec to ceb58442306e (5 revisions) (flutter/flutter#165159) 2025-03-13 [email protected] [FGP conversion] Port `FlutterExtension` from Groovy to Kotlin (flutter/flutter#165143) 2025-03-13 [email protected] Prevent explicit roles from merging (flutter/flutter#164732) ...
…8922) Manual roll Flutter from b16430b to 1d954f4 (114 revisions) Manual roll requested by [email protected] flutter/flutter@b16430b...1d954f4 2025-03-17 [email protected] Revert "[skwasm] Dynamic Threading (#164748)" (flutter/flutter#165350) 2025-03-17 [email protected] Roll Skia from fa669e2e6d12 to 52130e5c3b34 (4 revisions) (flutter/flutter#165348) 2025-03-17 [email protected] `OverlayPortal.childLayoutBuilder` should rebuild when `OverlayPortal` rebuilds. (flutter/flutter#165331) 2025-03-17 [email protected] [web][a11y]Delete _childContainerElement (flutter/flutter#163662) 2025-03-17 [email protected] Roll Skia from e45207898e60 to fa669e2e6d12 (8 revisions) (flutter/flutter#165342) 2025-03-17 [email protected] Add documentation for Java test filtering to plugins test document (flutter/flutter#165314) 2025-03-17 [email protected] Roll Fuchsia Linux SDK from SDNQgVXxHbbd0qsVw... to mPniqXmPpXqMMpM8z... (flutter/flutter#165313) 2025-03-17 [email protected] Roll Dart SDK from 9283d47199b7 to 725172afbc42 (1 revision) (flutter/flutter#165310) 2025-03-17 [email protected] feat(Tooltip): replace the height parameter with constraints (flutter/flutter#163314) 2025-03-17 [email protected] Fix arrowHeadColor breaks differentiation between states (flutter/flutter#165178) 2025-03-17 [email protected] Removes assumption that basis scalar and rounded_scalar match (flutter/flutter#165166) 2025-03-17 [email protected] Roll Skia from 69cf4c2c5db8 to e45207898e60 (1 revision) (flutter/flutter#165300) 2025-03-17 [email protected] Refactor: Move sliders value indicator shape to seperate file (flutter/flutter#162858) 2025-03-17 [email protected] Roll Skia from 3931c31032c7 to 69cf4c2c5db8 (1 revision) (flutter/flutter#165288) 2025-03-17 [email protected] Delete `docs/infra/Infra-Ticket-Queue.md` (flutter/flutter#165258) 2025-03-16 [email protected] Roll Skia from 3413a02d6fc8 to 3931c31032c7 (1 revision) (flutter/flutter#165277) 2025-03-16 [email protected] Roll Fuchsia Linux SDK from LPz5j18JDsms41r3T... to SDNQgVXxHbbd0qsVw... (flutter/flutter#165275) 2025-03-16 [email protected] Roll Dart SDK from 067560bcd521 to 9283d47199b7 (1 revision) (flutter/flutter#165269) 2025-03-16 [email protected] Roll Skia from f124daeb564d to 3413a02d6fc8 (1 revision) (flutter/flutter#165263) 2025-03-15 [email protected] Roll Dart SDK from 40bb66a945e4 to 067560bcd521 (1 revision) (flutter/flutter#165262) 2025-03-15 [email protected] Roll Fuchsia Linux SDK from efdpJgW4DIV6j1mO1... to LPz5j18JDsms41r3T... (flutter/flutter#165252) 2025-03-15 [email protected] Roll Dart SDK from f23d496f0585 to 40bb66a945e4 (1 revision) (flutter/flutter#165250) 2025-03-15 [email protected] Roll Dart SDK from 8814749ec6a4 to f23d496f0585 (1 revision) (flutter/flutter#165246) 2025-03-15 [email protected] Roll Skia from 4568e766ed0a to f124daeb564d (1 revision) (flutter/flutter#165245) 2025-03-15 [email protected] Revert "Prevent explicit roles from merging (#164732)" (flutter/flutter#165222) 2025-03-15 [email protected] Roll Skia from bac6e76abfc7 to 4568e766ed0a (5 revisions) (flutter/flutter#165241) 2025-03-14 [email protected] Roll Dart SDK from a51f1bfa0f6a to 8814749ec6a4 (2 revisions) (flutter/flutter#165227) 2025-03-14 [email protected] Roll Skia from 98b6922deecf to bac6e76abfc7 (5 revisions) (flutter/flutter#165225) 2025-03-14 [email protected] Point ktlint AS docs to the `.editorconfig` that is actually used by ci, instead of making a copy in the README (flutter/flutter#165213) 2025-03-14 [email protected] Add remaining dart fixes for Color deprecations when importing painting.dart (flutter/flutter#162609) 2025-03-14 [email protected] [Accessibility] Add required semantics flags (flutter/flutter#164585) 2025-03-14 [email protected] Roll Skia from f4467ff38f1f to 98b6922deecf (5 revisions) (flutter/flutter#165215) 2025-03-14 [email protected] Convert `BaseFlutterTask` From Groovy to Kotlin (flutter/flutter#163148) 2025-03-14 [email protected] `OverlayPortal.overlayChildLayoutBuilder` (flutter/flutter#164034) 2025-03-14 [email protected] Remove redundant `useMaterial3: true` (flutter/flutter#163376) 2025-03-14 [email protected] Roll Packages from 9cc6f37 to ff7724c (1 revision) (flutter/flutter#165197) 2025-03-14 [email protected] Changelog updates from 3.29.2 (flutter/flutter#165194) 2025-03-14 [email protected] Roll Dart SDK from 576514b2bfce to a51f1bfa0f6a (1 revision) (flutter/flutter#165191) 2025-03-14 [email protected] Roll Dart SDK from ceb58442306e to 576514b2bfce (2 revisions) (flutter/flutter#165180) 2025-03-14 [email protected] Roll Fuchsia Linux SDK from qXOLczyRJadxMW0PK... to efdpJgW4DIV6j1mO1... (flutter/flutter#165175) 2025-03-14 [email protected] [Impeller] Enable mediatek on API 34+. (flutter/flutter#165156) 2025-03-14 [email protected] Roll Dart SDK from cd06d4ba4fec to ceb58442306e (5 revisions) (flutter/flutter#165159) 2025-03-13 [email protected] [FGP conversion] Port `FlutterExtension` from Groovy to Kotlin (flutter/flutter#165143) 2025-03-13 [email protected] Prevent explicit roles from merging (flutter/flutter#164732) ...
This adds "required" semantic nodes, which indicate a node that requires user input before a form can be submitted. On Flutter Web, these get converted into [`aria-required` attributes](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-required). Addresses flutter#162139 ### Example app _⚠️ This example app includes a `DropdownMenu` which currently produces an incorrect semantics tree. That will be fixed by flutter#163638 Today, you wrap your control in a `Semantics(required: true, child ...)`. For example: <details> <summary>Example app with required semantic flags...</summary> ```dart import 'dart:ui'; import 'package:flutter/material.dart'; import 'package:flutter/semantics.dart'; void main() { runApp(const MyApp()); SemanticsBinding.instance.ensureSemantics(); } class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp(home: Scaffold(body: const MyForm())); } } class MyForm extends StatefulWidget { const MyForm({super.key}); @OverRide State<MyForm> createState() => MyFormState(); } class MyFormState extends State<MyForm> { int _dropdownValue = 0; bool _checkboxValue = false; int _radioGroupValue = 0; @OverRide Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Semantics(required: true, child: TextField()), Semantics( required: true, child: DropdownMenu<int>( initialSelection: _dropdownValue, onSelected: (value) => setState(() => _dropdownValue = value ?? 0), dropdownMenuEntries: [ DropdownMenuEntry(value: 0, label: 'Dropdown entry 1'), DropdownMenuEntry(value: 1, label: 'Dropdown entry 2'), ], ), ), ListTile( title: Text('Checkbox'), leading: Semantics( required: true, child: Checkbox( value: _checkboxValue, onChanged: (value) => setState(() => _checkboxValue = value ?? false), ), ), ), Semantics( label: 'Radio group', role: SemanticsRole.radioGroup, explicitChildNodes: true, required: true, child: Column( children: <Widget>[ ListTile( title: const Text('Radio 1'), leading: Radio<int>( value: 0, groupValue: _radioGroupValue, onChanged: (int? value) => setState(() => _radioGroupValue = value ?? 0), ), ), ListTile( title: const Text('Radio 2'), leading: Radio<int>( value: 1, groupValue: _radioGroupValue, onChanged: (int? value) => setState(() => _radioGroupValue = value ?? 0), ), ), ], ), ), Padding( padding: const EdgeInsets.symmetric(vertical: 16), child: ElevatedButton(onPressed: () {}, child: const Text('Submit')), ), ], ); } } ``` </details> <details> <summary>Semantics tree...</summary> ``` SemanticsNode#0 │ Rect.fromLTRB(0.0, 0.0, 645.0, 1284.0) │ └─SemanticsNode#1 │ Rect.fromLTRB(0.0, 0.0, 645.0, 1284.0) │ textDirection: ltr │ └─SemanticsNode#2 │ Rect.fromLTRB(0.0, 0.0, 645.0, 1284.0) │ sortKey: OrdinalSortKey#e3336(order: 0.0) │ └─SemanticsNode#3 │ Rect.fromLTRB(0.0, 0.0, 645.0, 1284.0) │ flags: scopesRoute │ ├─SemanticsNode#4 │ Rect.fromLTRB(0.0, 0.0, 645.0, 48.0) │ actions: didGainAccessibilityFocus, didLoseAccessibilityFocus, │ focus, tap │ flags: isTextField, hasEnabledState, isEnabled, hasRequiredState, │ isRequired │ textDirection: ltr │ text selection: [0, 0] │ currentValueLength: 0 │ ├─SemanticsNode#5 │ │ Rect.fromLTRB(0.0, 48.0, 199.3, 96.0) │ │ flags: hasRequiredState, isRequired │ │ │ └─SemanticsNode#7 │ │ Rect.fromLTRB(0.0, 0.0, 199.3, 48.0) │ │ actions: didGainAccessibilityFocus, didLoseAccessibilityFocus, │ │ focus, moveCursorBackwardByCharacter, moveCursorBackwardByWord, │ │ moveCursorForwardByCharacter, moveCursorForwardByWord, tap │ │ flags: isTextField, hasEnabledState, isEnabled │ │ value: "Dropdown entry 1" │ │ textDirection: ltr │ │ text selection: [15, 15] │ │ currentValueLength: 16 │ │ │ ├─SemanticsNode#9 │ │ Rect.fromLTRB(4.0, 4.0, 44.0, 44.0) │ │ actions: focus, tap │ │ flags: hasSelectedState, isButton, hasEnabledState, isEnabled, │ │ isFocusable │ │ │ └─SemanticsNode#8 │ Rect.fromLTRB(155.3, 4.0, 195.3, 44.0) │ actions: focus, tap │ flags: hasSelectedState, isButton, hasEnabledState, isEnabled, │ isFocusable │ ├─SemanticsNode#10 │ │ Rect.fromLTRB(0.0, 96.0, 645.0, 144.0) │ │ flags: hasSelectedState, hasEnabledState, isEnabled │ │ label: "Checkbox" │ │ textDirection: ltr │ │ │ └─SemanticsNode#11 │ Rect.fromLTRB(16.0, 4.0, 56.0, 44.0) │ actions: focus, tap │ flags: hasCheckedState, hasEnabledState, isEnabled, isFocusable, │ hasRequiredState, isRequired │ ├─SemanticsNode#12 │ │ Rect.fromLTRB(0.0, 144.0, 645.0, 240.0) │ │ flags: hasRequiredState, isRequired │ │ label: "Radio group" │ │ textDirection: ltr │ │ role: radioGroup │ │ │ ├─SemanticsNode#13 │ │ │ Rect.fromLTRB(0.0, 0.0, 645.0, 48.0) │ │ │ flags: hasSelectedState, hasEnabledState, isEnabled │ │ │ label: "Radio 1" │ │ │ textDirection: ltr │ │ │ │ │ └─SemanticsNode#14 │ │ Rect.fromLTRB(16.0, 8.0, 48.0, 40.0) │ │ actions: focus, tap │ │ flags: hasCheckedState, isChecked, hasSelectedState, isSelected, │ │ hasEnabledState, isEnabled, isInMutuallyExclusiveGroup, │ │ isFocusable │ │ │ └─SemanticsNode#15 │ │ Rect.fromLTRB(0.0, 48.0, 645.0, 96.0) │ │ flags: hasSelectedState, hasEnabledState, isEnabled │ │ label: "Radio 2" │ │ textDirection: ltr │ │ │ └─SemanticsNode#16 │ Rect.fromLTRB(16.0, 8.0, 48.0, 40.0) │ actions: focus, tap │ flags: hasCheckedState, hasSelectedState, hasEnabledState, │ isEnabled, isInMutuallyExclusiveGroup, isFocusable │ └─SemanticsNode#17 Rect.fromLTRB(0.0, 256.0, 92.7, 288.0) actions: focus, tap flags: isButton, hasEnabledState, isEnabled, isFocusable label: "Submit" textDirection: ltr thickness: 1.0 ``` </details> <details> <summary>HTML generated by Flutter web...</summary> ```html <html> <body flt-embedding="full-page" flt-renderer="canvaskit" flt-build-mode="debug" spellcheck="false" style=""> <flt-announcement-host> <flt-announcement-polite aria-live="polite" style=""> </flt-announcement-polite> <flt-announcement-assertive aria-live="assertive" style=""> </flt-announcement-assertive> </flt-announcement-host> <flutter-view flt-view-id="0" tabindex="0" style=""> <flt-glass-pane> </flt-glass-pane> <flt-text-editing-host> </flt-text-editing-host> <flt-semantics-host style=""> <flt-semantics id="flt-semantic-node-0" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-1" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-2" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-3" role="dialog" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-4" style=""> <input type="text" spellcheck="false" autocorrect="on" autocomplete="on" data-semantics-role="text-field" aria-required="true" style=""> </flt-semantics> <flt-semantics id="flt-semantic-node-5" aria-required="true" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-7" style=""> <input type="text" spellcheck="false" autocorrect="off" autocomplete="off" data-semantics-role="text-field" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-9" role="button" tabindex="0" aria-selected="false" flt-tappable="" style=""> </flt-semantics> <flt-semantics id="flt-semantic-node-8" role="button" tabindex="0" aria-selected="false" flt-tappable="" style=""> </flt-semantics> </flt-semantics-container> </flt-semantics> </flt-semantics-container> </flt-semantics> <flt-semantics id="flt-semantic-node-10" role="group" aria-label="Checkbox" aria-selected="false" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-11" tabindex="0" aria-required="true" flt-tappable="" role="checkbox" aria-checked="false" style=""> </flt-semantics> </flt-semantics-container> </flt-semantics> <flt-semantics id="flt-semantic-node-12" role="radiogroup" aria-label="Radio group" aria-required="true" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-13" role="group" aria-label="Radio 1" aria-selected="false" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-14" tabindex="0" flt-tappable="" role="radio" aria-checked="true" style=""> </flt-semantics> </flt-semantics-container> </flt-semantics> <flt-semantics id="flt-semantic-node-15" role="group" aria-label="Radio 2" aria-selected="false" style=""> <flt-semantics-container style=""> <flt-semantics id="flt-semantic-node-16" tabindex="0" flt-tappable="" role="radio" aria-checked="false" style=""> </flt-semantics> </flt-semantics-container> </flt-semantics> </flt-semantics-container> </flt-semantics> <flt-semantics id="flt-semantic-node-17" role="button" tabindex="0" flt-tappable="" style=""> </flt-semantics-container> </flt-semantics> </flt-semantics-container> </flt-semantics> </flt-semantics-container> </flt-semantics> </flt-semantics-container> </flt-semantics> </flt-semantics-host> </flutter-view> </body> </html> ``` </details> In the future, we can update Material and Cupertino widgets to automatically make their semantics node required when desirable. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
This adds "required" semantic nodes, which indicate a node that requires user input before a form can be submitted.
On Flutter Web, these get converted into
aria-requiredattributes.Addresses #162139
Example app
DropdownMenuwhich currently produces an incorrect semantics tree. That will be fixed by #163638.Today, you wrap your control in a
Semantics(required: true, child ...). For example:Example app with required semantic flags...
Semantics tree...
HTML generated by Flutter web...
In the future, we can update Material and Cupertino widgets to automatically make their semantics node required when desirable.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.