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

feat(file-uploader): add support for onChange #4906

Conversation

joshblack
Copy link
Contributor

When going through the FileUploader story, it seemed that we were calling this.props.onChange in handleChange unconditionally, even though this prop is not defined in propTypes and has no default value. This PR updates to include onChange in propTypes and conditionally calls it if it exists.

Changelog

New

Changed

  • Add onChange to FileUploader.propTypes and conditionally call it in handleChange

Removed

Testing / Reviewing

  • Verify no exception is thrown when using the file uploader story to upload a file

@joshblack joshblack requested a review from a team as a code owner December 17, 2019 19:27
@ghost ghost requested review from aledavila and emyarod December 17, 2019 19:28
@netlify
Copy link

netlify bot commented Dec 17, 2019

Deploy preview for carbon-elements failed.

Built with commit 0d82207

https://app.netlify.com/sites/carbon-elements/deploys/5dfa541e51c9a9000a02895f

@netlify
Copy link

netlify bot commented Dec 17, 2019

Deploy preview for the-carbon-components ready!

Built with commit 0d82207

https://deploy-preview-4906--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Dec 17, 2019

Deploy preview for carbon-components-react ready!

Built with commit 0d82207

https://deploy-preview-4906--carbon-components-react.netlify.com

Copy link
Contributor

@asudoh asudoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 - Thanks @joshblack!

@joshblack joshblack merged commit 66abfcf into carbon-design-system:master Dec 18, 2019
@joshblack joshblack deleted the fix/update-file-uploader-on-change branch December 18, 2019 16:55
This was referenced Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants