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

FilterableMultiSelect onChange() not working as documented #551

Closed
wdiu opened this issue May 20, 2020 · 4 comments · Fixed by #765
Closed

FilterableMultiSelect onChange() not working as documented #551

wdiu opened this issue May 20, 2020 · 4 comments · Fixed by #765
Assignees
Labels

Comments

@wdiu
Copy link

wdiu commented May 20, 2020

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,

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().

@wdiu wdiu changed the title FilterableMultiSelect onChange not working as documented FilterableMultiSelect onChange() not working as documented May 20, 2020
@SimonFinney SimonFinney added type: bug Something isn't working severity: 3 Low severity labels May 21, 2020
@SimonFinney
Copy link
Contributor

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.

@wdiu
Copy link
Author

wdiu commented Jul 14, 2020

Great, thanks, @SimonFinney!

@SimonFinney
Copy link
Contributor

🎉 This issue has been resolved in version 1.33.0-prerelease.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@SimonFinney
Copy link
Contributor

🎉 This issue has been resolved in version 1.33.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants