Skip to content

[A11y] TextField incorrect semantics ordering when there are prefix or suffix #148248

@chunhtai

Description

@chunhtai

Steps to reproduce

  1. Turn on talkback and traverse the textfield

Expected results

It should focus
abc -> @gmail.com -> xyz -> @gmail.com

Actual results

abc -> xyz -> @gmail.com -> @gmail.com

Code sample

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

void main() {
  runApp(MaterialApp(
    home: HomePage(),
  ));
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Home")),
      body: Center(
        child: Column(
          children: [
            TextField(
              decoration: const InputDecoration(
                labelText: 'Email',
                suffixText: '@gmail.com',
                hintText: 'Enter your email',
              ),
              enabled: false,
              controller: TextEditingController(text: 'abc'),
            ),
            TextField(
              decoration: const InputDecoration(
                labelText: 'Email',
                suffixText: '@gmail.com',
                hintText: 'Enter your email',
              ),
              enabled: false,
              controller: TextEditingController(text: 'xyz'),
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: text inputEntering text in a text field or keyboard related problemsteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions