mdbootstrap / bootstrap-templates

A collection for Bootstrap 5 templates.

Home Page:https://mdbootstrap.com/freebies/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

InputSize recommended use of real character lengths

Lost-FFRL opened this issue · comments

commented

inputSize = Math.max(1, this.placeholderText.length); Math.max(this.inputSize, $input.val().length);
Chinese characters is 2 length,placeholderText not fully displayed。
function() {
var len = 0;
for (var i=0; i<this.length; i++) {
if ((this.charCodeAt(i) & 0xff00) != 0){
len ++;
}
len ++;
} return len;
}