Skip to content

Fix checkbox click for checkboxes without a label.#540

Closed
arkwright wants to merge 1 commit intoelastic:masterfrom
arkwright:fix-checkbox-click
Closed

Fix checkbox click for checkboxes without a label.#540
arkwright wants to merge 1 commit intoelastic:masterfrom
arkwright:fix-checkbox-click

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 cjcenizal and snide 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