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

fix(tile): adds onChange call to handlers in selectable tile #5156

Merged
merged 8 commits into from
Jan 27, 2020
Merged

fix(tile): adds onChange call to handlers in selectable tile #5156

merged 8 commits into from
Jan 27, 2020

Conversation

abbeyhrt
Copy link
Contributor

Closes #5130

This PR adds a call to onChange on handleClick and handleKeydown so that it's called when people select a tile through the traditional methods. This removes the isInput check from handleClick because the input is a 1x1 square behind the label and can not be clicked. It also adds a test to make sure the onChange handler is called

Changelog

New

  • test for onChange prop

Changed

  • adds onChange call to handlers

Removed

  • isInput from handleClick

Testing / Reviewing

Pull down the PR, add a console.log to the onChange prop and verify that onChange is called when a tile is selected.

@abbeyhrt abbeyhrt requested a review from a team as a code owner January 23, 2020 18:25
@ghost ghost requested review from asudoh and dakahn January 23, 2020 18:25
@netlify
Copy link

netlify bot commented Jan 23, 2020

Deploy preview for the-carbon-components ready!

Built with commit 0691601

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

@netlify
Copy link

netlify bot commented Jan 23, 2020

Deploy preview for carbon-components-react failed.

Built with commit 0691601

https://app.netlify.com/sites/carbon-components-react/deploys/5e2b8f240d31290008fca90f

@netlify
Copy link

netlify bot commented Jan 23, 2020

Deploy preview for carbon-elements ready!

Built with commit 0691601

https://deploy-preview-5156--carbon-elements.netlify.com

Copy link
Contributor

@dakahn dakahn left a comment

Choose a reason for hiding this comment

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

Cool! 🏄

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.

Just one change suggestion - Thanks @abbeyhrt!

packages/react/src/components/Tile/Tile-test.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of that! 👍 ✅

@abbeyhrt abbeyhrt merged commit 1ebf04a into carbon-design-system:master Jan 27, 2020
@abbeyhrt abbeyhrt deleted the selectable-onchange branch January 27, 2020 15:31
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.

[SelectableTile]: onChange not fired
4 participants