Skip to content

Semantics for Checkbox should react to the three-state mixed state #110107

Closed

Description

@yaakovschectman

Continuation of #96218. When a three-state Checkbox is in the mixed state, the semantic flags for it do not update to reflect this.

Minimal example:

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  bool? isChecked = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: ListView(
        children: [
          CheckboxListTile(
            autofocus: true,
            onChanged: (value) => setState(() {
              isChecked = value;
            }),
            title: const Text('Tristate Value Checked'),
            tristate: true,
            value: isChecked,
          ),
          CheckboxListTile(
            value: isChecked ?? true,
            onChanged: (value) => setState(() {
              isChecked = value ?? false;
            }),
            title: const Text('Flag'),
          )
        ],
      ),
    );
  }
}

The tristate Checkbox should set the system object state STATE_SYSTEM_MIXED when it is in the mixed state. Currently, instead, it can be only in the checked or unchecked states dictated by STATE_SYSTEM_CHECKED.

This will require changes to the engine, as well.

Activity

  1. added
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    platform-windowsBuilding on or for Windows specifically
    platform-webWeb applications specifically
    P2Important issues not at the top of the work list
    on Aug 23, 2022
  2. cbracken commented on Aug 25, 2022

    @cbracken
    Member

    /cc @chrisnorman7. Thanks for reporting this!

  3. yaakovschectman commented on Sep 8, 2022

    @yaakovschectman
    ContributorAuthor

    Closed by #111032

  4. chrisnorman7 commented on Sep 8, 2022

    @chrisnorman7

    Hi,
    Thank you so much for the work you've put into this.

    Tristate now works perfectly on Windows. Unfortunately the half-checked state is not read by NVDA when running in Chrome though.

  5. github-actions commented on Sep 22, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: desktopRunning on desktopplatform-webWeb applications specificallyplatform-windowsBuilding on or for Windows specifically

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions