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 checkbox click for checkboxes without a label. #540

Closed
wants to merge 1 commit into from

Conversation

arkwright
Copy link
Contributor

@arkwright arkwright commented Mar 19, 2018

Unfortunately #407 broke checkboxes without labels — they aren't clickable using a mouse. This fixes that.

Currently the <input> is rendered offscreen, a <div> is used visually in its place, and a <label> is overlayed on top of the <div> to receive mouse clicks.

This PR brings the <input> back onscreen and visually it using opacity:0. I also added cursor:pointer for consistency with the <label>. I should note that some consider this to be a usability antipattern.

@arkwright arkwright force-pushed the fix-checkbox-click branch from 605918a to ca5b9e6 Compare March 19, 2018 22:10
@arkwright arkwright requested review from snide and cjcenizal March 19, 2018 22:10
@cchaos cchaos self-requested a review March 19, 2018 22:16
@cchaos
Copy link
Contributor

cchaos commented Mar 19, 2018

Technically, #407 didn't break this functionality ;) It was always like this and you are able to add the propinList to be sure that it displayed without a label.

Perhaps we just need to change that prop name, or add an alias to the prop name, that says noLabel and appends that class.

@cchaos
Copy link
Contributor

cchaos commented Mar 19, 2018

And we should probably add the same ability to the radio buttons as well.

@arkwright
Copy link
Contributor Author

Ah, thanks! I see what's going on now. Upgrading from 0.0.21 to 0.0.22 (which contains #407) did break our code, but that's because we weren't passing type="inList". When I add that type, everything works.

I'll open another issue for the semantic discussion.

@arkwright arkwright closed this Mar 19, 2018
@arkwright arkwright deleted the fix-checkbox-click branch March 20, 2018 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants