Turn brieflyShowPassword back on on iOS (#157466)

Fixes https://github.com/flutter/flutter/issues/115359

This patch should restore the `brieflyShowPassword` behavior on iOS before https://github.com/flutter/flutter/pull/104335.

On iOS new characters are still temporarily revealed if the user is entering using the software keyboard (potentially because it's easy to fat finger using on screen keyboards?).
This commit is contained in:
LongCatIsLooong
2024-10-23 16:22:15 -07:00
committed by GitHub
parent 0fd477d7f8
commit 2d3697216b
2 changed files with 2 additions and 4 deletions

View File

@@ -5357,10 +5357,8 @@ class EditableTextState extends State<EditableText> with AutomaticKeepAliveClien
String text = _value.text;
text = widget.obscuringCharacter * text.length;
// Reveal the latest character in an obscured field only on mobile.
// Newer versions of iOS (iOS 15+) no longer reveal the most recently
// entered character.
const Set<TargetPlatform> mobilePlatforms = <TargetPlatform> {
TargetPlatform.android, TargetPlatform.fuchsia,
TargetPlatform.android, TargetPlatform.fuchsia, TargetPlatform.iOS,
};
final bool brieflyShowPassword = WidgetsBinding.instance.platformDispatcher.brieflyShowPassword
&& mobilePlatforms.contains(defaultTargetPlatform);

View File

@@ -4980,7 +4980,7 @@ void main() {
await tester.pump(const Duration(milliseconds: 500));
await tester.pump(const Duration(milliseconds: 500));
expect((findRenderEditable(tester).text! as TextSpan).text, '•••');
});
}, variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.iOS, TargetPlatform.android, TargetPlatform.fuchsia, }));
group('a11y copy/cut/paste', () {
Future<void> buildApp(MockTextSelectionControls controls, WidgetTester tester) {