-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
TextInput - focusable but not editable #2151
Comments
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. |
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Couldn't find version numbers for the following packages in the issue:
Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3. The versions mentioned in the issue for the following packages differ from the latest versions on npm:
Can you verify that the issue still exists after upgrading to the latest versions of these packages? |
Another use case for this would be supporting a date picker input that should display a static (non-editable value) as well as a calendar icon. Pressing the right icon (calendar) can open the date picker dialog and should focus the field (to trigger validation on previous field, etc). This is only possible currently by using |
Hello 👋, this issue has been open for more than 2 months with no activity on it. If the issue is still present in the latest version, please leave a comment within 7 days to keep it open, otherwise it will be closed automatically. If you found a solution on workaround for the issue, please comment here for others to find. If this issue is critical for you, please consider sending a pull request to fix the issue. |
Uncertain if this is still necessary for @gregfenton, but I can still see applications for it. |
The workaround I listed above is ... not a good UX. It is possible to wind up with weird behaviours based on timing issues because the control is actually allowing the user to interact with the value...it just overwrites what the user does with the initial value. Not a good solution. Thanks for the ping @kendallroth ! |
Is your feature request related to a problem? Please describe.
A TextInput can be
disabled={true}
(grey text, no focus, no edit), and it can beeditable={false}
(normal color text, no focus, no edit). However, it would be very handy to allow focus while still not allowing editable.Why? Because if the text is focusable, then it can be highlighted & copied to the clipboard (via standard OS capabilities).
Describe the solution you'd like
Either make
editable={false}
allow focus, but not edit; or add a new setting to support as described above (focus but not edit).Describe alternatives you've considered
I have a TextInput with a onChangeText that simply returns the initial value passed into the component:
expo: 38.0.8
@expo/vector-icons 10.2.0
react-native: 0.62.2
react-native-paper: 4.0.1
The text was updated successfully, but these errors were encountered: