Skip to content

AccessibilityFocusBlockType.blockNode not working in Flutter Web #191484

Closed

Description

@marwfair

Steps to reproduce

Run the sample code as a flutter web app (Chrome).
Turn on accessibility (VoiceOver) and enable accessibility by triggering the hidden accessibility button.
Using the control+option+arrow keys, navigate between the widgets on the screen.

Run the same app on android.
Turn on accessibility (TalkBack).
Tap on the widgets to select them or swipe to navigate between the widgets on the screen.

This is related to this PR that has been closed: #182789

Expected results

Chrome and android should behave the same.

When the user selects the +/- buttons, the screen reader should announce the current count.

The count Text widget should not be selectable/focusable by the screen reader.

Actual results

On Chrome and android, selecting the +/- buttons is updating and announcing the count as expected, but on Chrome, the count text is selectable by the screen reader and is announced when in focus. This should not happen.

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:flutter/semantics.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: CounterPage(),
    );
  }
}

class CounterPage extends StatefulWidget {
  const CounterPage({super.key});

  @override
  State<CounterPage> createState() => _CounterPageState();
}

class _CounterPageState extends State<CounterPage> {
  int _counter = 0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Semantics(
              liveRegion: true,
              label: 'Counter: $_counter',
              accessibilityFocusBlockType:
                  AccessibilityFocusBlockType.blockNode,
              child: ExcludeSemantics(
                child: Text(
                  '$_counter',
                  style: Theme.of(context).textTheme.displayLarge,
                ),
              ),
            ),
            const SizedBox(height: 32),
            Row(
              mainAxisAlignment: MainAxisAlignment.center,
              spacing: 16,
              children: [
                IconButton.filled(
                  onPressed: () => setState(() => _counter--),
                  icon: const Icon(Icons.remove),
                  tooltip: 'Decrement',
                ),
                IconButton.filled(
                  onPressed: () => setState(() => _counter++),
                  icon: const Icon(Icons.add),
                  tooltip: 'Increment',
                ),
              ],
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2026-08-21.at.10.50.50.AM.mov
Screen.Recording.2026-08-21.at.10.55.08.AM.mov

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.47.0, on macOS 26.4.1 25E253 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[!] Xcode - develop for iOS and macOS (Xcode 26.6)
    ! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web

Activity

  1. added
    platform-webWeb applications specifically
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    fyi-webFor the attention of Web platform team
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    on Aug 21, 2026
  2. mbcorona commented on Aug 21, 2026

    @mbcorona
    Member

    HI @marwfair, thanks for the detailed report and video evidence.
    Routing to the accessibility team and flagging web, noted related #182789

  3. mdebbar commented on Aug 26, 2026

    @mdebbar
    Contributor

    Idea: set role="none" when a node is blocked with blockNode.

    Quick question: why are you using blockNode with ExcludeSemantics on the same node? I'm trying to understand your use case better.

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Aug 26, 2026
  5. hannah-hyj commented on Aug 26, 2026

    @hannah-hyj
    Member

    thought: To achieve blocking one node but not its children, maybe we should just not building the semantics dom node in web engine?

  6. added
    P3Issues that are less important to the Flutter project
    on Aug 26, 2026
  7. marwfair commented on Sep 1, 2026

    @marwfair
    Author

    Idea: set role="none" when a node is blocked with blockNode.

    Quick question: why are you using blockNode with ExcludeSemantics on the same node? I'm trying to understand your use case better.

    Good question. ExcludeSemantics may not be needed. I just ran the example again on android and it seemed to work without out it.

    The use case here is that I want want be able to use a liveRegion on the counter text so the updated count is announced when the +/- buttons are pressed, and I don't want the Text widget to be selectable by the screen reader and announced when focused. In the example, it is announcing "Counter 1", but I could also change it to announce something like "Counter updated to 1", which could be confusing to the user if they just focused on the text and didn't actually update the quantity.

  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 1, 2026
  9. github-actions commented on Oct 16, 2026

    @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.

  10. locked as resolved and limited conversation to collaborators on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions