Repository navigation
Disabled TextField InputDecoration errorText allocates space but is not shown #67409
Copy link
Copy link
Open
flutter/packages
#12589Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6Found to occur in 3.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Steps to Reproduce
-
Create a
TextFieldthat hasenabled: falseand hasdecoration: InputDecoration(). -
Code of the sample app:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) => MaterialApp(
title: 'Flutter Demo',
home: MyHomePage(),
);
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) => Scaffold(
body: Center(
child: Padding(
padding: EdgeInsets.all(16),
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Container(
color: Colors.green.withOpacity(0.4),
child: TextField(
enabled: false,
decoration: InputDecoration(
hintText: 'hintText',
),
),
),
SizedBox(height: 8),
Container(
color: Colors.orange.withOpacity(0.4),
child: TextField(
enabled: false,
decoration: InputDecoration(hintText: 'hintText', errorText: 'Error text'),
),
),
SizedBox(height: 8),
Container(
color: Colors.red.withOpacity(0.4),
child: TextField(
decoration: InputDecoration(hintText: 'hintText', errorText: 'Error text'),
),
),
]),
),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}Expected results:
To my mind, TextField should not allocate the space if it is disabled or it should still display the errorText;
Actual results:
At the moment it allocates the space but does not show the error itself;
Example image:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtText rendering, possibly libtxtfound in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6Found to occur in 3.6has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team

Activity
darshankawar commentedon Oct 6, 2020
Issue replicable on latest stable. Tested on Android 8.1.0.
If the textfield is disabled that has
errorText, the space is rendered even though the text is not, similar to an enabled textfield minus the error text.flutter doctor -v
maheshj01 commentedon Nov 25, 2022
The issue is still reproducible as of the latest
stable 3.3and themaster 3.6channel, The error text take space when the error is not present.code sample
flutter doctor -v (mac)
ashimthapa01 commentedon Oct 3, 2023
what is the update in this issue???
Add additional deep research findings - Phase 2