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

TextInput textAlign center + value/defaultValue prop causes cursor to jump to the right end of input #26512

Closed
janpe opened this issue Sep 20, 2019 · 3 comments
Labels
Bug Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@janpe
Copy link

janpe commented Sep 20, 2019

Having a TextInput that gets a value or defaultValue prop and has textAlign: 'center' in its styles causes a bug that puts the cursor at the right end of the input when the input is cleared.

React Native version:
0.60.5

Steps To Reproduce

  1. Have a TextInput that gets a value or defaultValue prop passed to it and has style textAlign: center.
  2. Type some text into the input.
  3. Clear the input.
  4. The input cursor jumps to the right end of the input.

Describe what you expected to happen:

Have the cursor at the center of the input after clearing the input.

Snack, code example, screenshot, or link to a repository:

<TextInput
  style={{textAlign: 'center'}}
  value={value}
/>```
@janpe janpe added the Bug label Sep 20, 2019
@react-native-bot react-native-bot added the Component: TextInput Related to the TextInput component. label Sep 20, 2019
@janpe
Copy link
Author

janpe commented Sep 20, 2019

Edited the description: defaultValue also causes this to occur.

@janpe janpe changed the title TextInput textAlign center + value prop causes cursor to jump to the right end of input TextInput textAlign center + value/defaultValue prop causes cursor to jump to the right end of input Sep 23, 2019
@stale
Copy link

stale bot commented Dec 22, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 22, 2019
@stale
Copy link

stale bot commented Jan 3, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jan 3, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Jan 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Component: TextInput Related to the TextInput component. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants