Skip to main content

Search and Top Navigation

#9601 closed bug (fixed)

Opened October 14, 2013 08:04AM UTC

Closed October 16, 2013 08:22PM UTC

Last modified November 26, 2013 08:55PM UTC

Widget: calling _setOption with undefined as 3rd argument makes it a getter

Reported by: Gruewo Owned by:
Priority: minor Milestone: 1.10.4
Component: ui.widget Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

calling $('#...').widgetname('option', 'optionName', undefined) does not set the option to undefined, instead it returns the current value, which breaks method chaining, is undocumented ( http://api.jqueryui.com/jQuery.widget/#method-_setOption ) and breaks my expectation of being a setter.

See http://bugs.jquery.com/ticket/9427 for a similar issue that has been fixed some time ago.

Attachments (0)
Change History (6)

Changed October 14, 2013 12:30PM UTC by tj.vantoll comment:1

status: newopen
summary: calling _setOption with undefined as 3rd argument makes it a getterWidget: calling _setOption with undefined as 3rd argument makes it a getter

Agree that we should probably follow the precedent from core. Test case - http://jsfiddle.net/tj_vantoll/FQPzq/.

Changed October 15, 2013 03:50AM UTC by dekajp comment:2

Changed October 16, 2013 08:22PM UTC by Jyoti Deka comment:3

resolution: → fixed
status: openclosed

Widget: option-method should work as getter only when argument length is 1. Fixes #9601 - Widget: calling _setOption with undefined as 3rd argument makes it a getter

Changeset: ecde7cd41a59e9c3ff07f56baeeaec2147cca779

Changed October 18, 2013 05:12PM UTC by scottgonzalez comment:4

milestone: none1.11.0

Changed November 26, 2013 08:54PM UTC by Jyoti Deka comment:5

Widget: option-method should work as getter only when argument length is 1. Fixes #9601 - Widget: calling _setOption with undefined as 3rd argument makes it a getter

(cherry picked from commit ecde7cd41a59e9c3ff07f56baeeaec2147cca779)

Changeset: 6cdebe84f8fb20374bb9dd32b62cba1b7f8dfd13

Changed November 26, 2013 08:55PM UTC by scottgonzalez comment:6

milestone: 1.11.01.10.4