Skip to content

All characters in a text field are deleted when attempting to edit contents with a mask and an initial value is specified. #7230

Description

@gd-kunstrux

Can we access your project?

  • I give permission for members of the FlutterFlow team to access and test my project for the sole purpose of investigating this issue.

Current Behavior

When you attempt to edit the value in a text field that was pre-populated through the initial value property the entire value is deleted. For example, if I have an initial value of 214-555-1212, with a custom mask of ###-###-####, and the keyboard set to Phone, any keystroke while the text field has focus will result in the initial value being wiped out.

Expected Behavior

You should be able to edit the masked initial value as you would be able to if you typed it in manually.

Steps to Reproduce

  1. Create a new project.
  2. Drop a Text Field on the home page and make the following setting changes:
    • Initial Value: 214-555-1212
    • Keyboard Type: Phone
    • Mask: Custom
    • Custom Mask: ###-###-####
  3. Run the application through Test Mode or locally connected to an Android or iOS emulator.
  4. Set the focus in the text field, the cursor will be placed at the end of the string.
  5. Hit any key and the whole string will be deleted. Most commonly someone would hit the backspace key which results in the same issue. But literally any edit to the text field will wipe out the initial value.

Reproducible from Blank

  • The steps to reproduce above start from a blank project.

Bug Report Code (Required)

IT80i/Lqx412odxE0LruLcdB/SAXHGZ/aII7kcNxexAbB4zyEokMPvfvNxBWOLzidEFpGkaimmc13Mr4vePxEfkpaAeCf75z/qluWD3le16VVLHXCpewY0F8HeRQCB2e352s2BB5BPhvdXclxkyMA+iiZCrUQJ/6IjA7LeWiFKXXpXCjFnjVUCFU0TUXHm2bD/QXIVDq+f6QspZl1eTjzw==

Visual documentation

Environment

- FlutterFlow version: 7.0.12
- Platform: Android / iOS
- Browser name and version: N/A
- Operating system and version affected: macOS Tahoe Version 26.5.1

Additional Information

I have queried the community and found at least two other people with this issue, and it's been around for years. Here is an example:

https://community.flutterflow.io/ask-the-community/post/why-does-this-error-happen-OyZXsPxpm4tcieq

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions