相关疑难解决方法(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万
查看次数

为什么用户/代理商不能选择电子邮件地址或号码?

Chrome已对我的测试中导致此错误的数字输入进行了更改

Uncaught InvalidStateError: Failed to read the 'selectionStart' property from 'HTMLInputElement': The input element's type ('number') does not support selection

我想了解为什么数字/电子邮件输入不能选择(原文如此)?

javascript browser google-chrome

10
推荐指数
1
解决办法
2358
查看次数

如何使jquery.inputmask与input type = number一起使用?

只要输入类型=文本,我就可以使用此插件正常运行代码,但我想使用type = number,以便在移动设备上显示正确的键盘.

有没有办法做到这一点,希望有一些我在文档中遗漏的设置?

这是我的HTML:

<input id="Price" name="Price" type="number" placeholder="0.00" tabindex="3"/>
Run Code Online (Sandbox Code Playgroud)

这是我的js:

$(document).ready(function(){
    $('#Price').inputmask("[9][9]9.99", {
        numericInput: true,
        "placeholder": "0",
        showMaskOnHover: false,
        greedy: false
    });
});
Run Code Online (Sandbox Code Playgroud)

jquery jquery-inputmask

5
推荐指数
2
解决办法
9663
查看次数