键入时Chrome的HTML输入类型时间问题

时间:2019-03-12 14:05:40

标签: angularjs html5 google-chrome

我希望我能找到解决方案。 我为angularjs项目提供了以下html标签,该标签应有助于选择时间。

<input class="input-time" type='time' ng-model="dr.startTime">

时间可以AM / PM格式显示,我可以接受。问题是我尝试输入小时: 12 ,但是如果您不够快(例如立即单击1 + 2),它只会更改时间的第二位数字。有时,即使我超快完成操作,它也会显示第二个数字。 请帮助解决此问题。

1 个答案:

答案 0 :(得分:0)

在最新版本的Chrome中,time input似乎不存在任何已知问题:

https://caniuse.com/#feat=input-datetime

您可以在以下代码片段中进行测试。对我来说很好。

<input class="input-time" type='time' ng-model="dr.startTime">

唯一的情况是单击箭头按钮,然后键入数字。在这种情况下,由于已经有一个数字,您只需要输入第二个数字,因此在输入第二个数字后,光标会跳至分钟字段。