Skip to main content

Search and Top Navigation

#7261 closed bug (fixed)

Opened April 16, 2011 09:57AM UTC

Closed May 18, 2011 02:35PM UTC

Last modified May 27, 2011 12:03PM UTC

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 [https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.button.js#L20 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.

Attachments (0)
Change History (4)

Changed May 07, 2011 06:59AM UTC by kzys comment:1

Changed May 18, 2011 02:35PM UTC by scottgonzalez comment:2

resolution: → fixed
status: newclosed

Fixed in e0fafbb73526f60fdeab3f75532d6a4059d0d82a.

Changed May 18, 2011 02:35PM UTC by scottgonzalez comment:3

milestone: 1.91.8.14

Merged into 1-8-stable in c45dd91f1b25a9edb8e168acf58e7224c46e0182.

Changed May 27, 2011 12:03PM UTC by rdworth comment:4

#7429 is a duplicate of this ticket.