jQuery-Knob icon indicating copy to clipboard operation
jQuery-Knob copied to clipboard

Triggering change does not call user's change callback

Open ThomasKliszowski opened this issue 10 years ago • 5 comments

When I create a knob like this:

<script>
    $(".dial").knob({
        'change' : function (v) { console.log(v); }
    });
</script>

And I trigger a change:

<script>
    $('.dial')
        .val(27)
        .trigger('change');
</script>

I think that my change callback should be called, but it isn't.

Here is and example: http://codepen.io/ThomasKliszowski/pen/GgpjdX

ThomasKliszowski avatar Dec 01 '14 09:12 ThomasKliszowski

@ThomasKliszowski which browser are you using? Just quickly tried it in Chrome 39.0.2171.71 m and it works fine.

HaykoKoryun avatar Dec 01 '14 10:12 HaykoKoryun

I use Chrome 39.0.2171.71, the same as yours. When I load the codepen link above and I check out the Javascript console, I should see "27":

$(".dial").knob({
  'change' : function (v) { console.log(v); }
});

$('.dial')
  .val(27)
  .trigger('change');

But nothing is displayed.

ThomasKliszowski avatar Dec 01 '14 14:12 ThomasKliszowski

I'm having the same issue. I'm using Google Chrome 39.0.2171.71 m too.

I tried both:

$(".dial").knob({
  'change' : function (v) { console.log(v); }
});
$('.dial')
  .val(27)
  .trigger('change');

And

$(".dial").knob({
  'release' : function (v) { console.log(v); }
});
$('.dial')
  .val(27)
  .trigger('release');

Neither worked.

ghost avatar Dec 09 '14 04:12 ghost

Apologies for reposting. I wanted to change my email address.

I'm having the same issue. I'm using Google Chrome 39.0.2171.71 m too.

I tried both:

$(".dial").knob({
  'change' : function (v) { console.log(v); }
});
$('.dial')
  .val(27)
  .trigger('change');

And

$(".dial").knob({
  'release' : function (v) { console.log(v); }
});
$('.dial')
  .val(27)
  .trigger('release');

Neither worked.

reallyroy avatar Dec 09 '14 04:12 reallyroy

Same issue here.

benolayinka avatar Dec 09 '18 16:12 benolayinka