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

Adding then removing focus from a ComboBox gives a warning in the console #3637

Closed
2 tasks done
mattchapleau opened this issue Aug 2, 2019 · 0 comments · Fixed by #3646
Closed
2 tasks done

Adding then removing focus from a ComboBox gives a warning in the console #3637

mattchapleau opened this issue Aug 2, 2019 · 0 comments · Fixed by #3646

Comments

@mattchapleau
Copy link

What package(s) are you using?

  • carbon-components -> 10.4.0
  • carbon-components-react -> 7.4.1

Detailed description

Describe in detail the issue you're having.
If you add focus to the combo box but then click outside of the combo box so it loses focus, the following warning appears in the console:

Warning: An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.

Is this issue related to a specific component?
Yes, ComboBox

What did you expect to happen? What happened instead? What would you like to
see changed?
There should be no warning logged in the console when a combo box loses focus.

What browser are you working in?
Chrome, Edge and Firefox

What version of the Carbon Design System are you using?
carbon-components version 10.4.0
carbon-components-react version 7.4.1

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?

Steps to reproduce the issue

  1. Open the code sandbox and click on or add focus to the combo box
  2. Click outside of the combo box or cause it to lose focus
  3. Check the console and see the warning message

Please create a reduced test case in CodeSandbox

https://codesandbox.io/embed/codesandbox-wrm5h

asudoh pushed a commit to asudoh/carbon-components that referenced this issue Aug 5, 2019
Downshift `v1`'s 'onInputValueChange' seems to be called from React
state updater function and thus calling `setState()` in
`onInputValueChange` handler causes React's "An update was scheduled
from inside an update function" warning.

Fixes carbon-design-system#2543.
Fixes carbon-design-system#3637.
asudoh pushed a commit to asudoh/carbon-components that referenced this issue Aug 5, 2019
Downshift `v1`'s `onInputValueChange` seems to be called from React
state updater function and thus calling `setState()` in
`onInputValueChange` handler causes React's "An update was scheduled
from inside an update function" warning.

Fixes carbon-design-system#2543.
Fixes carbon-design-system#3637.
tw15egan pushed a commit that referenced this issue Aug 5, 2019
* fix(ComboBox): switch from onInputValueChange to onStateChange

Downshift `v1`'s `onInputValueChange` seems to be called from React
state updater function and thus calling `setState()` in
`onInputValueChange` handler causes React's "An update was scheduled
from inside an update function" warning.

Fixes #2543.
Fixes #3637.

* test(ComboBox): update upon new internal API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant