【问题标题】:Input type number doesn't work on Window Surface Tablet输入类型编号在 Window Surface 平板电脑上不起作用
【发布时间】:2018-08-08 13:54:47
【问题描述】:

我注意到如果我们尝试打开https://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_number

在 Windows Surface Tablet 上的 Chrome 中,它的行为与在桌面浏览器中一样。 我的意思是在平板电脑(移动)设备上,如果我点击<input type="number">,Chrome 将显示数字键盘。但在 Surface Chrome 上会显示文本键盘。

此外,移动浏览器通过以下方式进一步提升用户体验 显示更适合输入数字的特殊键盘 用户尝试输入一个值。 developer.mozilla.org

有没有办法强制 Windows Surface 上的 Chrome 充当移动浏览器?至少对于数字字段?

【问题讨论】:

    标签: html windows google-chrome input tablet


    【解决方案1】:

    我没有要测试的带有 Chrome 的 Windows Surface,但请尝试

     <input inputmode="numeric" pattern="[0-9]*" type="text" name="something">
    

    这仍然会强制浏览器打开数字键盘

    【讨论】:

      猜你喜欢
      • 2012-08-03
      • 1970-01-01
      • 2014-09-08
      • 1970-01-01
      • 2015-04-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-21
      相关资源
      最近更新 更多