diff --git a/select2.js b/select2.js index c6dae212..a010685b 100644 --- a/select2.js +++ b/select2.js @@ -1255,10 +1255,11 @@ the specific language governing permissions and limitations under the Apache Lic postRender(); } - if (opts.maximumSelectionSize >=1) { + var maxSelSize = $.isFunction(opts.maximumSelectionSize) ? opts.maximumSelectionSize() : opts.maximumSelectionSize; + if (maxSelSize >=1) { data = this.data(); - if ($.isArray(data) && data.length >= opts.maximumSelectionSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) { - render("