Skip to main content

Search and Top Navigation

#5195 closed bug (fixed)

Opened February 17, 2010 06:45PM UTC

Closed February 18, 2010 02:48AM UTC

.buttonset() prevents change event from being catchable.

Reported by: ajpiano Owned by:
Priority: blocker Milestone: 1.8
Component: ui.button Version: 1.8rc2
Keywords: Cc:
Blocked by: Blocking:
Description

As originally discovered at http://forum.jquery.com/topic/jqueryui-1-8rc2-button-events, the buttonset is preventing the change event from being caught on radio buttons within the buttonset, on the buttonset element itself, or on any other element in the DOM (via .live() or change bubbling).

To see this bug in action, please see http://jsbin.com/ahami/14

Attachments (0)
Change History (3)

Changed February 17, 2010 07:04PM UTC by Rwhitbeck comment:1

Closed 5193 as dup of this ticket and bringing description over to consolidate:

  • The change event of checkboxes setup with button() is always triggered twice: once with the old state, and once with the new one.
  • The change event for radiobuttons that are setup with buttonset() is never triggered.

forum: http://forum.jquery.com/topic/jqueryui-1-8rc2-button-events

Test case: http://jsbin.com/ahami/2

Changed February 17, 2010 09:10PM UTC by rdworth comment:2

priority: criticalblocker

Changed February 18, 2010 02:48AM UTC by scottgonzalez comment:3

resolution: → fixed
status: newclosed

Fixed in r3826.

We were triggering a click event on checkboxes and radio buttons when clicking on the button. This resulted in the following actions when clicking on the button:

  • user clicks button (label)
  • native click event is fired on label
  • click event handler is executed

-- checked attribute on radio button is updated (does not fire a change event)

-- click event is triggered on radio button

  • default action for clicking on the label occurs, which fires a native click event on the radio button
  • default action for click event occurs, which checks if the checked state has changed

-- the checked state has not changed because we had already checked the radio (does not fire a change event)