Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#9316 closed bug (fixed)

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

Reported by: Victor Homyakov Owned by: Scott González
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.

Change History (6)

comment:1 Changed 6 years ago by tj.vantoll

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.

comment:2 Changed 6 years ago by Scott González

Owner: set to 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.

comment:3 Changed 6 years ago by Scott González

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

comment:4 Changed 6 years ago by Scott González

Milestone: none1.11.0

comment:5 Changed 5 years ago by Scott González

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

comment:6 Changed 5 years ago by Scott González

Milestone: 1.11.01.10.4
Note: See TracTickets for help on using tickets.