Ответ 1
Я также столкнулся с той же проблемой в своем приложении
теперь я обработал его с помощью js, который удаляет все атрибуты maxlength из входного текста и текстового поля и останавливает пользователя от ввода более необходимого текста. Здесь предполагается, что все входные текстовые и текстовые поля имеют уникальный идентификатор.
Код также доступен на jsfiddle
$(document).ready(function () {
var ver = window.navigator.appVersion;
ver = ver.toLowerCase();
if ( ver.indexOf("android 4.1") >= 0 ){
var idMaxLengthMap = {};
//loop through all input-text and textarea element
$.each($(':text, textarea, :password'), function () {
var id = $(this).attr('id'),
maxlength = $(this).attr('maxlength');
//element should have id and maxlength attribute
if ((typeof id !== 'undefined') && (typeof maxlength !== 'undefined')) {
idMaxLengthMap[id] = maxlength;
//remove maxlength attribute from element
$(this).removeAttr('maxlength');
//replace maxlength attribute with onkeypress event
$(this).attr('onkeypress','if(this.value.length >= maxlength ) return false;');
}
});
//bind onchange & onkeyup events
//This events prevents user from pasting text with length more then maxlength
$(':text, textarea, :password').bind('change keyup', function () {
var id = $(this).attr('id'),
maxlength = '';
if (typeof id !== 'undefined' && idMaxLengthMap.hasOwnProperty(id)) {
maxlength = idMaxLengthMap[id];
if ($(this).val().length > maxlength) {
//remove extra text which is more then maxlength
$(this).val($(this).val().slice(0, maxlength));
}
}
});
}
});
Ошибка для этой проблемы уже была открыта в 35264