Repository navigation
When enabled is false on InputDecoration; helperText, errorText and counterText is showing #161602
Copy link
Copy link
Closed
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 problemsd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight
Description
Steps to reproduce
- Run example code
- Show how helperText and counterText is showing on app
- Can change and add the errorText to see it instead helperText
Expected results
When enabled is false, helperText, errorText and counterText is not showing on app
OR
That enable InputDecoration property documentation, do not says that helperText, errorText and counterText is not showing when enabled is false.
Actual results
When enabled is false, helperText, errorText and counterText is showing on app.
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter FormBuilder Example',
debugShowCheckedModeBanner: false,
localizationsDelegates: const [
...GlobalMaterialLocalizations.delegates,
GlobalWidgetsLocalizations.delegate,
],
home: const _ExamplePage(),
);
}
}
class _ExamplePage extends StatefulWidget {
const _ExamplePage();
@override
State<_ExamplePage> createState() => _ExamplePageState();
}
class _ExamplePageState extends State<_ExamplePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Minimal code example')),
body: Padding(
padding: const EdgeInsets.all(16),
child: TextFormField(
// autovalidateMode: AutovalidateMode.always,
// enabled: false,
decoration: const InputDecoration(
labelText: 'The language of my people',
helperText: 'Select your favorite programming languages',
counterText: '0/3',
errorText: 'Please select at least one language',
enabled: false,
),
),
),
);
}
}
Screenshots or Video
Logs
Logs
-- no logsFlutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.27.1, on Ubuntu 24.04.1 LTS 6.8.0-51-generic, locale en_US.UTF-8)
• Flutter version 3.27.1 on channel stable at /home/matias/fvm/versions/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 17025dd882 (4 weeks ago), 2024-12-17 03:23:09 +0900
• Engine revision cb4b5fff73
• Dart version 3.6.0
• DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4)
• Android SDK at /home/matias/Android/Sdk
• Platform android-35, build-tools 35.0.0-rc4
• Java binary at: /home/matias/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• CHROME_EXECUTABLE = /usr/bin/google-chrome
[✓] Linux toolchain - develop for Linux desktop
• Ubuntu clang version 18.1.3 (1ubuntu1)
• cmake version 3.28.3
• ninja version 1.11.1
• pkg-config version 1.8.1
[✓] Android Studio (version 2024.1)
• Android Studio at /home/matias/.local/share/JetBrains/Toolbox/apps/android-studio
• Flutter plugin version 81.0.2
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.96.2)
• VS Code at /snap/code/current/usr/share/code
• Flutter extension version 3.102.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Ubuntu 24.04.1 LTS 6.8.0-51-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177
[✓] Network resources
• All expected network resources are available.
• No issues found!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 problemsd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input teamwaiting for PR to land (fixed)A fix is in flightA fix is in flight

Activity
nate-thegrate commentedon Jan 14, 2025
Thank you @deandreamatias! I can confirm that the InputDecoration.enabled property claims that when
enabledis false, "helperText, errorText, and counterText are not displayed," and that this description does not match its current behavior.In the spirit of Hyrum's Law (and to allow full configurability), I think it makes the most sense to update the documentation so that it reflects the current behavior, so I'll label this issue as such.
sethmfuller commentedon Jan 15, 2025
I can submit a PR to fix this tomorrow. A good first issue for me as I'm wanting to dig into contributing to the Flutter repo. 🚀 FYI: @deandreamatias
sethmfuller commentedon Jan 15, 2025
PR submitted here: #161650
Fix incorrect [enabled] documentation (#161650)
Fix incorrect [enabled] documentation (flutter#161650)
github-actions commentedon Feb 5, 2025
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 -vand a minimal reproduction of the issue.