Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7261 closed bug (fixed)

Refresh scope in formResetHandler unintentionally wide

Reported by: jgarber Owned by:
Priority: minor Milestone: 1.8.14
Component: ui.button Version: 1.8.9
Keywords: Cc:
Blocked by: Blocking:

Description

When I reset a form that has UI buttons, the reset.button event is called, which is the function formResetHandler. It will refresh everything matching this selector: $( ":ui-button", event.target.form )

For me on Firefox 4.0 and Safari 5.0.4, event.target is the form that is being reset and event.target.form is undefined. Therefore, the scope is not limited and it finds all the ui-buttons on the page.

It causes problems for me because I'm using the jQuery-File-Upload plugin and I'm actually calling .button() on a form because with that plugin, the form acts as a button. Something in the refresh jams the uploader, so when I reset a different form on the page, the uploader stops working. That's irrelevant, though.... My point is that it appears you only want to refresh the buttons of the form that's being reset, but it's actually refreshing all ui-buttons on the page.

See http://jsfiddle.net/jgarber/pJzGb/

Apologies in advance if I'm not understanding the intention of that code properly.

Change History (4)

comment:2 Changed 6 years ago by scottgonzalez

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

comment:3 Changed 6 years ago by scottgonzalez

  • Milestone changed from 1.9 to 1.8.14

Merged into 1-8-stable in c45dd91f1b25a9edb8e168acf58e7224c46e0182.

comment:4 Changed 6 years ago by rdworth

#7429 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.