You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DOMException: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('number') does not support selection.
#7
Open
KiaraGrouwstra opened this issue
Oct 8, 2014
· 0 comments
Chrome currently throws this error:
DOMException: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('number') does not support selection.
I've worked around this by adjusting the script to the following, temporarily making the field type not 'number':
$(this).keypress(function (event) {
if (!event.charCode) return true;
var elType = this.type;
this.type = 'text';
var part1 = this.value.substring(0,this.selectionStart);
var part2 = this.value.substring(this.selectionEnd,this.value.length);
this.type = elType;
if (!mask.test(part1 + String.fromCharCode(event.charCode) + part2))
return false;
});
The text was updated successfully, but these errors were encountered:
Chrome currently throws this error:
DOMException: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('number') does not support selection.
I've worked around this by adjusting the script to the following, temporarily making the field type not 'number':
The text was updated successfully, but these errors were encountered: