Repository navigation
Closed
Labels
P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsengineflutter/engine related. See also e: labels.found in release: 3.16Found to occur in 3.16found in release: 3.18Found to occur in 3.18frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team
Description
Steps to reproduce
- Use android device
2.Add a TextField
3.Switch to the password entry box
4.Enter the maximum length and then switch to another place
5.Found plaintext displayed
Original title: Android TextField reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor and text is clearly displayed in the password box
Expected results
The maximum length cannot be entered, and the plaintext cannot be displayed
Actual results
4.Enter the maximum length and then switch to another place
5.Found plaintext displayed
Code sample
Code sample
TextField(
//文字默认小写
textCapitalization: TextCapitalization.none,
style: TextStyle(
color: FColor.text33,
fontSize: widget.fontSize ?? 18.fsp,
),
//是否能够复制粘贴
enableInteractiveSelection: true,
focusNode: widget.focusNode,
maxLength: 20,
autofocus: false,
controller: widget.controller,
inputFormatters: [
FilteringTextInputFormatter.deny(
RegExp(r'[\u4e00-\u9fa5.·\u36c3\u4DAE]'))
],
obscureText: hidePw,
textInputAction: TextInputAction.done,
keyboardType: TextInputType.visiblePassword,
decoration: InputDecoration(
icon: widget.needIcon
? SvgPicture.asset(
ImageAssets.accountIcLockSvg,
)
: null,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
isCollapsed: true,
hintText: widget.hintText,
hintStyle: TextStyle(
color: FColor.textCC,
fontSize: widget.fontSize ?? 18.fsp,
fontWeight: FontWeightPlus.w400),
counterText: '',
suffixIconConstraints: const BoxConstraints(
maxHeight: 24,
maxWidth: 15 + 11 + 24,
),
suffixIcon: Container(
margin: const EdgeInsets.only(right: 15, left: 11),
child: GestureDetector(
onTap: () {
setState(() {
hidePw = !hidePw;
});
},
child: Icon(
hidePw ? IconAssets.closeEye : Icons.remove_red_eye,
color: FColor.hintText,
)),
),
),
)
Screenshots or Video
Screenshots / Video demonstration
20ce162c8834da411396f1f307aba6cd.mov
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.16.5, on macOS 14.1.1 23B81 darwin-arm64, locale
zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.85.1)
[✓] Connected device (5 available)
[✓] Network resourcesMetadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsengineflutter/engine related. See also e: labels.found in release: 3.16Found to occur in 3.16found in release: 3.18Found to occur in 3.18frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team
Activity
[-]reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor is clearly displayed in the password box[/-][+]Android reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor is clearly displayed in the password box[/+][-]Android reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor is clearly displayed in the password box[/-][+]Android TextField reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor is clearly displayed in the password box[/+][-]Android TextField reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor is clearly displayed in the password box[/-][+]Android TextField reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor and text is clearly displayed in the password box[/+]dam-ease commentedon Jan 15, 2024
Thanks for filing this @assemblyios.
I can reproduce this on the latest
masterandstablechannels.Screen record
untitled.webm
Some observations during triage:
obscureText:true.onChangedproperty to print out changes, although the text shows on the phone screen as being input, no change takes place here, the number of text remains as the maximum andonChangeddoesn't print out any change.Code Sample
stable, master flutter doctor -v
assemblyios commentedon Jan 16, 2024
Yes, that's what you described. Thank you
[-]Android TextField reaches the maximum password value, switching to any position and entering a new character again should not take effect, but the location cursor and text is clearly displayed in the password box[/-][+]Flutter text field (on android) shows plain text character when max char limit reached and user attempts to insert in the middle of the string. [/+]Resolve issue flutter#141560: Force restartInput when framework updat…
Do not reveal obscured character when input is rejected by inputForma…