Explorar el Código

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

Igor Vaynberg hace 12 años
padre
commit
4e1873fb9d
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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);