Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove attribute readOnly in TextField and TextFormField #45604

Closed
hlemcke opened this issue Nov 26, 2019 · 3 comments
Closed

Remove attribute readOnly in TextField and TextFormField #45604

hlemcke opened this issue Nov 26, 2019 · 3 comments
Labels
a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@hlemcke
Copy link

hlemcke commented Nov 26, 2019

I suggest to remove attribute readOnly in TextField and TextFormField.

Removing this attribute would mean:

  • text will always be selectable
  • text will be editable when editable is true
  • text will not be editable when editable is false. If the developer wants to change the text appearance (e.g. rendering text in grey) then he may attach a proper Decoration.

Since this may break already existing functionality it could be necessary to add a new widget like InputText which can be used standalone or within a form.

See #45606 "Integrate enable/disable into FormState and FormField"

Reason:
This change will allow easier handling of input data for all type of input fields (use enabled in all of them).

The distinction between readOnly and enabled is a relic of old ages when there was only a keyboard to enter data with its tab key to jump from one field to the next one and to any actions. Nowadays we have mice and touch screens for direct access to actions without the need to "tab" through all input fields. Therefore this separation no longer makes sense.

@iapicca iapicca added a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability labels Nov 26, 2019
@HansMuller HansMuller added framework flutter/packages/flutter repository. See also f: labels. and removed a: text input Entering text in a text field or keyboard related problems labels Nov 26, 2019
@awhitford
Copy link

I would prefer being able to select text from a readOnly field.

@guidezpl guidezpl added the a: text input Entering text in a text field or keyboard related problems label Jun 18, 2020
@flutter flutter deleted a comment from flutterq Jan 15, 2021
@Hixie
Copy link
Contributor

Hixie commented Mar 17, 2023

I think we have to support this to honor the expectations of desktop platforms. You can definitely just not use it though. :-)

@Hixie Hixie closed this as completed Mar 17, 2023
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: text input Entering text in a text field or keyboard related problems c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

6 participants