Skip to content

TextField helper text and character count overlap when using OutlineInputBorder #175591

@math1man

Description

@math1man

Steps to reproduce

Internal b/445896477, client huggsy

Create a TextInput widget that specifies a decoration with a long helperText, an OutlineInputBorder, and a maxLength.

Expected results

The helper text should not overlap the character count.

Actual results

The helper text overlaps the character count.

Code sample

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: ListView(
          children: [
            const Text('Hello, World!'),
            Builder(
              builder: (context) => TextField(
                decoration: InputDecoration(
                  labelText: 'Label text',
                  helperText:
                      'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do '
                      'eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut '
                      'enim ad minim veniam, quis nostrud exercitation ullamco laboris '
                      'nisi ut aliquip ex ea commodo consequat.',
                  border: OutlineInputBorder(
                    borderSide: BorderSide(
                      color: Theme.of(context).colorScheme.outline,
                      width: 1,
                    ),
                    // Setting gapPadding to 0 fixes the bug, but is not desirable.
                    // Increasing the gapPadding exacerbates the bug.
                    // gapPadding: 0,
                    borderRadius: BorderRadius.all(Radius.circular(4)),
                  ),
                ),
                maxLength: 200,
              ),
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

Logs

Logs: N/A

Flutter Doctor output

Doctor output: N/A

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemscustomer: huggsy (g3)f: material designflutter/packages/flutter/material repository.found in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions