Ticket #5195 (closed bug: fixed)

Opened 4 years ago

Last modified 4 years ago

.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:
Blocking: Blocked by:

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

Change History

comment:1 Changed 4 years ago by Rwhitbeck

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

comment:2 Changed 4 years ago by rdworth

  • Priority changed from critical to blocker

comment:3 Changed 4 years ago by scott.gonzalez

  • Status changed from new to closed
  • Resolution set to fixed

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)

Note: See TracTickets for help on using tickets.