-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Toggle style checkboxes initialized with JS don't work #2572
Comments
If you remove the It's causing it to double trigger. I'll see if I can't handle this in JS. |
Hi Jlukic, Thanks for the quick response. The 'for' attribute is often (and in our case, definitely) required for accessibility reasons. Removing it breaks the link between the label and the input for screen readers and other accessibility assistive devices. It also breaks the fallback behaviour of the label triggering the input for touch devices - creating a larger target. If there's a clean fix that doesn't break that link, it would be superior. |
|
Hi Jlukic, After some considerable digging with a coworker, the answer seems quite simple. Let me know if you have any comments. |
Fixed in commit |
https://jsfiddle.net/pwkayddm/2/
.ui.toggle.checkboxes don't work when initialized with .checkbox() anymore.
I've included both a rails-style checkbox (two inputs - one hidden, one a checkbox) and a traditional single-element checkbox, both written in the traditional inline style used by simple_form among many other libraries.
These used to work just fine in Semantic-UI 1.x , but now their toggle behaviour isn't correct - it appears to be double triggering. I thought it was simply because the onClick is bound to the label, which usually causes a double call on the input itself, but fixing that didn't entirely solve the problem.
The text was updated successfully, but these errors were encountered: