Failed to execute 'setSelectionRange' on 'HTMLInputElement'
jcubic commented on 7 Jan2016When I use number input I've got error in Google ChromeUncaught InvalidStateError: Failed to execute 'setSelectionRange' on 'HTMLInputElement':The i
·
jcubic commented on 7 Jan 2016
|
The fix will be something like: activate: function() { if(this.$input.is(':visible')) { this.$input.focus(); var type = this.$input.attr('type'); if (type && type.match(/^(text|search|password|tel|url)$/i) || !type) { $.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length); } if(this.toggleClear) { this.toggleClear(); } } }, |
zorosun commented on 1 Aug 2016
|
@akakoori you might want to look at this I fixed it by inserting (function() { var original = $.fn.editableutils.setCursorPosition; $.fn.editableutils.setCursorPosition = function() { try { original.apply(this, Array.prototype.slice.call(arguments)); } catch (e) { /* noop */ } }; })(); |
可以改用type='text',就不会出现这个样子
当然,你也可以min= "0"
更多推荐
所有评论(0)
您需要登录才能发言
查看更多评论
jcubic commented on 7 Jan 2016
When I use number input I've got error in Google Chrome