We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d58f5b commit 69396daCopy full SHA for 69396da
1 file changed
select2.js
@@ -2285,16 +2285,20 @@ the specific language governing permissions and limitations under the Apache Lic
2285
},
2286
2287
// single
2288
- data: function(value, triggerChange) {
2289
- var data;
+ data: function(value) {
+ var data,
2290
+ triggerChange = false;
2291
2292
if (arguments.length === 0) {
2293
data = this.selection.data("select2-data");
2294
if (data == undefined) data = null;
2295
return data;
2296
} else {
2297
+ if (arguments.length > 1) {
2298
+ triggerChange = arguments[1];
2299
+ }
2300
if (!value) {
- this.clear(!!triggerChange);
2301
+ this.clear(triggerChange);
2302
2303
data = this.data();
2304
this.opts.element.val(!value ? "" : this.id(value));
0 commit comments