Skip to content

[web:a11y] LabelAndValue role overrides Checkable role #128468

@yjbanov

Description

@yjbanov

When the framework merges Checkbox semantics with Text semantics into a single node, the LabelAndValue role manager can take precedence and end up assigning role="text" to the HTML DOM element, which confuses screen readers.

Sample widget structure that leads to this situation:

  Widget build(BuildContext context) {
    return ListView(
      children: <Widget>[
        Row(
          children: [
            Checkbox(
              autofocus: true,
              value: _value,
              onChanged: (value) {
                setState(() {
                  _value = value!;
                });
              },
            ),
            const Text('this is a label'),
          ],
        ),
      ],
    );
  }

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)engineflutter/engine related. See also e: labels.platform-webWeb applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions