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

issue: useTsController eats onChange(undefined) and does not bubble it #137

Open
josiah-roberts opened this issue Aug 31, 2023 · 0 comments

Comments

@josiah-roberts
Copy link

Version Number

1.0.6

Codesandbox/Expo snack

No response

Steps to reproduce

  1. Have an optional field
  2. If you never touch it, the field value is unset (undefined)
  3. Touch the field
  4. You can now never set it back to undefined, because useTsController eats onChange(undefined)

This bug means that:

  • If an optional field has never been touched, it's undefined
  • If an optional field has been touched, the closest you can get to clearing it is setting it to null

Expected behaviour

Don't eat onChange(undefined). Forward it up to the passed onChange.

Relevant log output

No response

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

No branches or pull requests

1 participant