Skip to content

Accessibility focus positions not updated after keyboard dismiss when dialog is shown immediately #186178

Description

@luomo-pro

Steps to reproduce

  1. Enable TalkBack (Android) or VoiceOver (iOS)
  2. Run the minimal reproduction code below
  3. Tap the TextField at the bottom to open the keyboard
  4. Tap the "Hide Keyboard + Dialog" button
  5. Close the dialog
  6. Try to touch the TextField at its visual position (bottom of screen)

Expected results

Accessibility focus should be on the TextField at the bottom of the screen, matching its visual position.

Actual results

Accessibility focus for the TextField remains at its old position (middle of screen, where it was pushed up when the keyboard was open). Touching the bottom of the screen where the TextField is visually located produces no accessibility focus.

This affects both Android TalkBack and iOS VoiceOver.

Additionally, in more complex real-world scenarios (e.g. a chat page with a message list and a bottom input field), this issue can escalate further: the TextField may become completely unreachable ? neither touch exploration nor swipe navigation can focus it. We have not found 100% reliable steps to reproduce this more severe case, but we suspect it shares the same root cause. This makes the impact of this bug more serious than the basic reproduction suggests.

Minimal reproduction code

import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: TestPage()));

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Test')),
      body: Column(
        children: [
          ElevatedButton(
            onPressed: () {
              FocusManager.instance.primaryFocus?.unfocus();
              showDialog(
                context: context,
                builder: (ctx) => AlertDialog(
                  content: const Text('Test'),
                  actions: [
                    TextButton(
                      onPressed: () => Navigator.pop(ctx),
                      child: const Text('Close'),
                    ),
                  ],
                ),
              );
            },
            child: const Text('Hide Keyboard + Dialog'),
          ),
          Expanded(
            child: ListView.builder(
              itemCount: 50,
              itemBuilder: (_, i) => ListTile(title: Text('Item $i')),
            ),
          ),
          const Padding(
            padding: EdgeInsets.all(8),
            child: TextField(
              decoration: InputDecoration(hintText: 'Input'),
            ),
          ),
        ],
      ),
    );
  }
}

Flutter version

Flutter 3.44.0-1.0.pre-374 ? channel master
Engine ? revision 87e2f2cd20
Tools ? Dart 3.13.0

Affected platforms

  • Android (TalkBack)
  • iOS (VoiceOver)

Activity

  1. saurabh-mirajkar commented on May 7, 2026

    @saurabh-mirajkar
    Contributor

    @luomo-pro Thanks for the report. Labelling for team-accessibility to investigate further.

  2. added
    platform-androidAndroid applications specifically
    platform-iosiOS applications specifically
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    and removed
    in triagePresently being triaged by the triage team
    on May 7, 2026
  3. added
    P2Important issues not at the top of the work list
    on May 13, 2026
  4. mbcorona commented on Sep 2, 2026

    @mbcorona
    Member

    Hi @luomo-pro, thanks for the code sample.
    Reproduced on iOS 26.6.1 and Flutter 3.47

  5. self-assigned this
    on Sep 2, 2026
  6. github-actions commented on Sep 18, 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.

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)platform-androidAndroid applications specificallyplatform-iosiOS 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