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

Fix issue dismissing keyboard resetting value #189

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

LiamMorrow
Copy link
Owner

On android, when the keyboard was dismissed, it would reset the value of the textfield

This commit changes the behaviour of the textfields to emit their values on input rather than onchange, which ensures the state is always up to date.

This was an issue before because on inputs which used decimals, it would strip the decimal point during the state loop, meaning the user couldn't input them. I fixed this by only updating the internal input's value from the props when it doesn't have focus

Before:

Screen.Recording.2024-07-03.at.08.55.24.mov

After:

Screen.Recording.2024-07-03.at.08.56.35.mov

On android, when the keyboard was dismissed, it would reset the value of the textfield

This commit changes the behaviour of the textfields to emit their values on input rather than onchange, which ensures the state is always up to date.

This was an issue before because on inputs which used decimals, it would strip the decimal point during the state loop, meaning the user couldn't input them.  I fixed
this by only updating the internal input's value from the props when it doesn't have focus
@LiamMorrow LiamMorrow merged commit 26399ff into main Jul 2, 2024
7 checks passed
@LiamMorrow LiamMorrow deleted the fix-keyboard-issue branch July 2, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant