You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug - FilterableMultiSelect onChange() not working as documented
FilterableMultiSelect documents onChange() as:
/**
* `onChange` is a utility for this controlled component to communicate to a
* consuming component what kind of internal state changes are occuring.
*/
onChange: PropTypes.func,
To work as documented and communicate internal state changes, it needs to handle Downshift's onStateChange(), which according to Downshift's documentation: "This function is called anytime the internal state changes" https://github.com/downshift-js/downshift#onstatechange
Actual behavior -
onChange() is only called when the selected item changes.
Steps for reproducing
Look for "handleOnChange" in FilterableMultiSelect.js -- you will see it is mapped to Downshift's onChange() instead of onStateChange().
Screenshots
N/A - issue in code
Affected browsers
N/A - issue in code
Optional information
v1.23.0
I suggest adding an onStateChange() to avoid breaking the existing implementations of onChange().
The text was updated successfully, but these errors were encountered:
wdiu
changed the title
FilterableMultiSelect onChange not working as documented
FilterableMultiSelect onChange() not working as documented
May 20, 2020
Hi @wdiu - Thanks for raising! There has been a recent PR to Carbon that may resolve this issue you've been experiencing - carbon-design-system/carbon#6427
If so, this will be included as part of their next release.
Bug - FilterableMultiSelect onChange() not working as documented
FilterableMultiSelect documents onChange() as:
However, in the code it only invoked when handling Downshift's onChange() which is only "Called when the selected item changes" according to Downshift's documentation here: https://github.com/downshift-js/downshift#onchange
Expected behavior -
To work as documented and communicate internal state changes, it needs to handle Downshift's onStateChange(), which according to Downshift's documentation: "This function is called anytime the internal state changes" https://github.com/downshift-js/downshift#onstatechange
Actual behavior -
onChange() is only called when the selected item changes.
Steps for reproducing
Look for "handleOnChange" in FilterableMultiSelect.js -- you will see it is mapped to Downshift's onChange() instead of onStateChange().
Screenshots
N/A - issue in code
Affected browsers
N/A - issue in code
Optional information
v1.23.0
I suggest adding an onStateChange() to avoid breaking the existing implementations of onChange().
The text was updated successfully, but these errors were encountered: