Ver Fonte

set maxlength on search when maximumInputLength is defined. closes #538

Igor Vaynberg há 12 anos atrás
pai
commit
4e1873fb9d
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      select2.js

+ 4 - 0
select2.js

@@ -724,6 +724,10 @@ the specific language governing permissions and limitations under the Apache Lic
                 this.monitorSource();
             }
 
+            if (opts.maximumInputLength !== null) {
+                this.search.attr("maxlength", opts.maximumInputLength);
+            }
+
             var disabled = opts.element.prop("disabled");
             if (disabled === undefined) disabled = false;
             this.enable(!disabled);