Skip to main content

Search and Top Navigation

#9316 closed bug (fixed)

Opened May 20, 2013 09:53AM UTC

Closed May 20, 2013 03:30PM UTC

Last modified November 26, 2013 03:34PM UTC

Widget: widgetEventPrefix is empty when widget is (occasionally) loaded twice

Reported by: victor-homyakov Owned by: scottgonzalez
Priority: minor Milestone: 1.10.4
Component: ui.widget Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

When widgetEventPrefix isn't defined explicitly, and the same widget is loaded more than once (e.g. because of wrong production build script or race condition in asynchronous loading), then widgetEventPrefix is set to empty string as in this fiddle: http://jsfiddle.net/9cRa3/1/

This may lead to hardly reproducible errors.

Attachments (0)
Change History (6)

Changed May 20, 2013 12:29PM UTC by tj.vantoll comment:1

status: newopen
summary: widgetEventPrefix is empty when widget is (occasionally) loaded twiceWidget: widgetEventPrefix is empty when widget is (occasionally) loaded twice

Seems like we could just use

existingConstructor.prototype.widgetEventPrefix
in the first half of the ternary here: https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L109.

Changed May 20, 2013 12:49PM UTC by scottgonzalez comment:2

owner: → scott.gonzalez
status: openassigned

I don't think we can use existingContructor.prototypefor anything since we're not dealing with inheritance. The conditional just needs to be stricture.

Changed May 20, 2013 03:30PM UTC by Scott González comment:3

resolution: → fixed
status: assignedclosed

Widget: Properly set widgetEventPrefix when redefining a widget. Fixes #9316 - Widget: widgetEventPrefix is empty when widget is (occasionally) loaded twice.

Changeset: 2eb89f07341a557084fa3363fe22afe62530654d

Changed May 20, 2013 03:31PM UTC by scottgonzalez comment:4

milestone: none1.11.0

Changed November 26, 2013 03:34PM UTC by Scott González comment:5

Widget: Properly set widgetEventPrefix when redefining a widget. Fixes #9316 - Widget: widgetEventPrefix is empty when widget is (occasionally) loaded twice.

(cherry picked from commit 2eb89f07341a557084fa3363fe22afe62530654d)

Changeset: c241313f1d31b18751a81c1321662512d8086cbc

Changed November 26, 2013 03:34PM UTC by scottgonzalez comment:6

milestone: 1.11.01.10.4