相关疑难解决方法(0)

selectionStart/selectionEnd输入类型="数字"不再允许在Chrome中使用

我们的应用程序在输入字段上使用selectionStart来确定当用户按下箭头键时是否自动将用户移动到下一个/上一个字段(即,当选择位于文本末尾并且用户按下右箭头时我们移动到下一个字段,否则)

Chrome现在阻止在type ="number"的地方使用selectionStart.它现在抛出异常:

Failed to read the 'selectionStart' property from 'HTMLInputElement': The input element's type ('number') does not support selection.
Run Code Online (Sandbox Code Playgroud)

见如下:

https://codereview.chromium.org/100433008/#ps60001

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#do-not-apply

有没有办法在type ="number"的输入字段中确定插入符的位置?

javascript google-chrome

73
推荐指数
6
解决办法
4万
查看次数

标签 统计

google-chrome ×1

javascript ×1