aurelia / ux

A user experience framework with higher-level capabilities, designed to bring simplicity and elegance to building cross-device, rich experiences.
MIT License
368 stars 55 forks source link

fix(checkbox): enable label click #305

Closed MaximBalaganskiy closed 4 years ago

bigopon commented 4 years ago

Can you give some description about the motivation for this change?

MaximBalaganskiy commented 4 years ago

Default browser checkbox allows toggle via label clicking. It's quite inconvenient to aim for the square which is relatively small.

bigopon commented 4 years ago

Shouldn't connecting a label to a checkbox be the job of the user? There' ways to do it: wrapping inside a label, id + for, adding the listener by users themselves. Also, it doesn't seem correct to only take care of immediate sibling, and especially only next sibling.

MaximBalaganskiy commented 4 years ago

Wrapping in label works. Although styling is needed to align text with the checkbox and enable cursor pointer