Skip to content

Textformfield obscureText is not displayed as expected on iOS #115359

@sami-kouatli-act

Description

@sami-kouatli-act

Steps to Reproduce

  1. Execute flutter run on the code sample
  2. Write text inside the TextFormField

Expected results:

  • See the character displayed for few seconds then it is replaced by the obscure character.
  • When a character is written, previous characters are directly replace by an obscure character.

Actual results:
It works on Android in both Debug and Release.
It does not work as expected on iOS in both Debug and Release.

Result Android Debug Video :

androidDebug

Result Android Release Video :

androidRelease

Result iOS Debug Video :

iosDebug

Result iOS Release :

No video but I have the same behaviour as Debug on my phone.

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Padding(
          padding: const EdgeInsets.symmetric(horizontal: 20.0),
          child: TextFormField(obscureText: true),
        ),
      ),
    );
  }
}
Logs

Flutter doctor :

[✓] Flutter (Channel stable, 3.3.4, on macOS 13.0.1 22A400 darwin-arm, locale
    fr-FR)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms bettera: text inputEntering text in a text field or keyboard related problemsf: material designflutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3found in release: 3.6Found to occur in 3.6frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions