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

Text input clearing to blank after selecting a location only on Android #815

Closed
2 of 4 tasks
KrisLau opened this issue Apr 27, 2022 · 1 comment
Closed
2 of 4 tasks
Labels

Comments

@KrisLau
Copy link

KrisLau commented Apr 27, 2022

Describe the bug

Code was working as expected for iOS however when I went to test on Android the textbox was getting cleared out immediately after selecting a location from the list. The issue disappears whenever I remove setting the value in textInputProps. However even then when I try to read the location in the frontend, it returns an empty string. (Video attached below). I think it may be related to #647 (comment), specifically this part:

There's also a weird thing with the onChangeText firing immediately with an empty string, but that is probably for a reason, and we can work around that!

but that's just a guess on my part

Reproduction - (required - issue will be closed without this)

I created a snack but it doesn't seem to be doing it there, not sure why. The only difference between the snack and my code is that in my code, the places-autocomplete is a component with props sent in.

Additional context

  • Library Version: [e.g. 1.4.2]

  • React Native Version: [e.g. 0.62.2]

  • iOS

  • Android

  • Web

If you are using expo please indicate here:

  • I am using expo

Add any other context about the problem here, screenshots etc

@KrisLau KrisLau added the bug label Apr 27, 2022
@KrisLau
Copy link
Author

KrisLau commented Apr 27, 2022

Nevermind I'm dumb and figured out I was setting it to blank in an onLayout. Not sure why that was only causing issues on Android though

@KrisLau KrisLau closed this as completed Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant