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

Programmatically focusing a TextInput with textAlign: 'center' that already has text starts the cursor off in the middle of the text #26994

Closed
devlinb opened this issue Oct 25, 2019 · 2 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

@devlinb
Copy link

devlinb commented Oct 25, 2019

If a <TextInput style={{ textAlign: 'center' }}/>`` element has text in it, and it is focused using inputRef.focus()``` the cursor starts off in the middle of the text.

The work around for #24519, is to focus TextInput for people using TalkBack on Android by manually focusing the control. Having the cursor start off in the middle of the text is a poor experience.

React Native version:

RN .59

Steps To Reproduce

See reproduction at https://snack.expo.io/r1eyi31cS which when ran on device shows that the bug happens in an number of ways.

Describe what you expected to happen:

Text editing cursor starts off at the end of the text being edited

Snack, code example, screenshot, or link to a repository: https://snack.expo.io/r1eyi31cS

@devlinb devlinb added the Bug label Oct 25, 2019
@react-native-bot react-native-bot added the Component: TextInput Related to the TextInput component. label Oct 25, 2019
@stale
Copy link

stale bot commented Jan 24, 2020

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 Jan 24, 2020
@stale
Copy link

stale bot commented Jan 31, 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 31, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Feb 1, 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