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

Controlled component doesnt trigger onChange when value is undefined #1436

Open
ShahAnuj2610 opened this issue Apr 27, 2020 · 0 comments
Open

Controlled component doesnt trigger onChange when value is undefined #1436

ShahAnuj2610 opened this issue Apr 27, 2020 · 0 comments
Labels
bug

Comments

@ShahAnuj2610
Copy link
Member

@ShahAnuj2610 ShahAnuj2610 commented Apr 27, 2020

Affected Projects

  • React
  • maybe (Vue)

Describe the bug

when any component is converted to controlled component with value={undefined}, then onChange doesn't get triggered (ideally it should).

To Reproduce

https://codesandbox.io/s/happy-flower-d02lm?file=/src/index.js

Expected behavior

onChange should get triggered

TODO: Solution

https://github.com/appbaseio/reactivesearch/blob/next/packages/web/src/components/list/MultiList.js#L199
We need to change this line on each component to check whether the value key was passed explicitly in props.

@ShahAnuj2610 ShahAnuj2610 added the bug label Apr 27, 2020
@jyash97 jyash97 changed the title Controlled component abnormal behavior when value===undefined Controlled component doesnt trigger onChange when value is undefined Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.