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: allow bluring of disabled field #2344

Merged
merged 1 commit into from
Nov 23, 2020

Conversation

haakandev
Copy link
Contributor

Summary

When trying to blur and set a TextInput as disabled at the same time, the blur does not take effect.
Example use case:

  • Form of TextInputs (and other inputs) where fields have their disabled prop set to true while submitting
  • While a TextInput is focused, user clicks a submit button that sets the above mentioned prop to loading
    Expected: The TextInput is blurred
    Actual: The TextInput is not properly blurred and left in a semi-focused state (no keyboard and greyed out, but but showing thicker underline)

See https://snack.expo.io/r8Cpj71On for iOS/Android

  1. Having the first TextInput focused when clicking the button works fine
  2. Focusing the second TextInput and clicking the button leaves the TextInput with a thicker underline as it is still in focused state

This PR fixes this by removing the check on disabled prop in handleBlur. If this existed for some other purpose, please let me know and maybe there's a different solution.

Test plan

See Snack above for testing

@callstack-bot
Copy link

Hey @haakandev, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

Copy link
Contributor

@jbinda jbinda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Trancever Trancever merged commit e606ac0 into callstack:master Nov 23, 2020
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.

None yet

4 participants