-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Labels
P1High-priority issues at the top of the work listHigh-priority issues 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 libtxtc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterc: regressionIt was better in the past than it is nowIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.23Found to occur in 1.23Found to occur in 1.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
Description
Doctor summary
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.1, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.50.0)
[✓] Connected device (1 available)
Steps to Reproduce
- Create
TextFieldas follows:
TextField(
maxLength: 5,
),
or
TextField(
maxLength: 5,
inputFormatters: [LengthLimitingTextInputFormatter(5)],
),
- Start typing some text
Expected results:
- TextField allows to enter only
maxLengthcharacters
Actual results:
- it's possible to enter more than
maxLengthcharacters
Looks like it's related to the following change introduced in flutter 1.22 - https://github.com/flutter/flutter/pull/63754/files
packages/flutter/lib/src/services/text_formatter.dart
///
/// ### Composing text behaviors
///
/// There is no guarantee for the final value before the composing ends.
/// So while the value is composing, the constraint of [maxLength] will be
/// temporary lifted until the composing ends.
///
/// In addition, if the current value already reached the [maxLength],
/// composing is not allowed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1High-priority issues at the top of the work listHigh-priority issues 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 libtxtc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterc: regressionIt was better in the past than it is nowIt was better in the past than it is nowcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 1.22Found to occur in 1.22Found to occur in 1.22found in release: 1.23Found to occur in 1.23Found to occur in 1.23frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work on
