#9601 closed bug (fixed)
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.
Change History (6)
comment:1 Changed 9 years ago by
Status: | new → open |
---|---|
Summary: | calling _setOption with undefined as 3rd argument makes it a getter → Widget: calling _setOption with undefined as 3rd argument makes it a getter |
comment:3 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
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
comment:4 Changed 9 years ago by
Milestone: | none → 1.11.0 |
---|
comment:5 Changed 9 years ago by
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
comment:6 Changed 9 years ago by
Milestone: | 1.11.0 → 1.10.4 |
---|
Agree that we should probably follow the precedent from core. Test case - http://jsfiddle.net/tj_vantoll/FQPzq/.