bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Suggestion: Button plugin should send a change event when selection in a radiogroup changes

Open scott-laursen opened this issue 13 years ago • 0 comments

Problem I cannot hook up to the "change" event for radiobuttons in a data-toggle="buttons" element. This is because the event does not trigger when setting the 'checked' property with .prop().

Solution Actively send the change event when the property is changed.

The code (in buttons.js, line 59)

var $input = this.$element.find('input')
  .prop('checked', !this.$element.hasClass('active'))
  .trigger('change') // this line is new

scott-laursen avatar Aug 01 '13 10:08 scott-laursen