Skip to content

[A11y] TextField should adapt to hint text sizes #148353

@chunhtai

Description

@chunhtai

b/317131589

Steps to reproduce

run app and activate the textfield

Expected results

According to internal guideline the the hint text can't be ellipisized when font size increases.

The material guideline suggest no ellipsis and no multiline
https://m3.material.io/components/text-fields/guidelines.

The native android expands the text field size to accommodate long string
image

Since we can't control how long the text developer can put into the hint text, I think we should follow native android to make it multi line and expand the textfield size.

Actual results

image

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.... Please, I really need it',
              ),
              controller: TextEditingController(text: 'abc'),
            ),
          ],
        ),
      ),
    );
  }
}

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)r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions