Respect -1
with minimumResultsForSearch
In past versions of Select2, supplying a value less than zero to `minimumResultsForSearch` acted the same as providing a high value, such as `Infinity`. This corrects the regression by mapping anything less than zero to the value `Infinity`. This closes https://github.com/select2/select2/issues/2994.
This commit is contained in:
parent
0f7a37b2d6
commit
1349579192
4
dist/js/select2.amd.full.js
vendored
4
dist/js/select2.amd.full.js
vendored
@ -3555,6 +3555,10 @@ define('select2/dropdown/minimumResultsForSearch',[
|
|||||||
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
||||||
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
||||||
|
|
||||||
|
if (this.minimumResultsForSearch < 0) {
|
||||||
|
this.minimumResultsForSearch = Infinity;
|
||||||
|
}
|
||||||
|
|
||||||
decorated.call(this, $element, options, dataAdapter);
|
decorated.call(this, $element, options, dataAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
dist/js/select2.amd.js
vendored
4
dist/js/select2.amd.js
vendored
@ -3555,6 +3555,10 @@ define('select2/dropdown/minimumResultsForSearch',[
|
|||||||
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
||||||
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
||||||
|
|
||||||
|
if (this.minimumResultsForSearch < 0) {
|
||||||
|
this.minimumResultsForSearch = Infinity;
|
||||||
|
}
|
||||||
|
|
||||||
decorated.call(this, $element, options, dataAdapter);
|
decorated.call(this, $element, options, dataAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
dist/js/select2.full.js
vendored
4
dist/js/select2.full.js
vendored
@ -3993,6 +3993,10 @@ define('select2/dropdown/minimumResultsForSearch',[
|
|||||||
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
||||||
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
||||||
|
|
||||||
|
if (this.minimumResultsForSearch < 0) {
|
||||||
|
this.minimumResultsForSearch = Infinity;
|
||||||
|
}
|
||||||
|
|
||||||
decorated.call(this, $element, options, dataAdapter);
|
decorated.call(this, $element, options, dataAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
dist/js/select2.full.min.js
vendored
2
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/select2.js
vendored
4
dist/js/select2.js
vendored
@ -3993,6 +3993,10 @@ define('select2/dropdown/minimumResultsForSearch',[
|
|||||||
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
||||||
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
||||||
|
|
||||||
|
if (this.minimumResultsForSearch < 0) {
|
||||||
|
this.minimumResultsForSearch = Infinity;
|
||||||
|
}
|
||||||
|
|
||||||
decorated.call(this, $element, options, dataAdapter);
|
decorated.call(this, $element, options, dataAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
dist/js/select2.min.js
vendored
2
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
@ -20,6 +20,10 @@ define([
|
|||||||
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
||||||
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
||||||
|
|
||||||
|
if (this.minimumResultsForSearch < 0) {
|
||||||
|
this.minimumResultsForSearch = Infinity;
|
||||||
|
}
|
||||||
|
|
||||||
decorated.call(this, $element, options, dataAdapter);
|
decorated.call(this, $element, options, dataAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user