checkboxes .on('click') bug #372

Closed
lucatros opened this Issue Feb 18, 2014 · 1 comment

Projects

None yet

2 participants

@lucatros

There is a problem with the checkboxes when using with some JQuery events.
For example, using the following code, if the checkbox is checked a <span> with the icons is added before the checkbox's <label> causing to look like this:

Before click:
screen shot 2014-02-18 at 6 01 12 pm

After click:
screen shot 2014-02-18 at 6 01 02 pm

HTML Code:

<label class="checkbox" for="checkbox1">
  <input type="checkbox" value="" id="checkbox1" data-toggle="checkbox">
  Checkbox
</label>

JQuery Code:

$('.checkbox').on('click', function() {
    $(this).checkbox('toggle');
});

To fix the issue I just wrapped the checkboxes in a DIV and I added some custom CSS to hide the addded <span>

New HTML code:

<div id="div_checkboxes">
<label class="checkbox" for="checkbox1">
  <input type="checkbox" value="" id="checkbox1" data-toggle="checkbox">
  Checkbox
</label>
</div>

Added CSS:

#div_checkboxes > span:first-child {
  display: none;
}

Not sure if this is a bug or if I'm doing something wrong. I'll appreciate any input on this issue.

@andrew-ml

Hi, lucatros,
this component is rewritten, you can check out the latest release.

@andrew-ml andrew-ml closed this Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment