【问题标题】:Input type number does not accept decimal in iOS输入类型数字在 iOS 中不接受十进制
【发布时间】:2017-05-12 09:50:01
【问题描述】:

我正在使用 Meteor + React 开发一个网络/混合移动应用程序。我有多个类型为number 的输入字段。一切都适用于 Android 和 Web,但不适用于 iOS。

我有这个示例代码(React 组件)

<InputBox containerClassName="input-field gray-border center"
          autoComplete="off" 
          className="validate center-align"
          type="number" name="currentWeight" unit="kgs"
          value=""/>

这个问题可能是什么原因造成的,我该如何解决这个问题?考虑到我还寻找其他解决方案无济于事,我已经为此摸索了几个小时。提前致谢

【问题讨论】:

    标签: ios html input


    【解决方案1】:

    step="0.01"支持2个十进制数

    <InputBox containerClassName="input-field gray-border center"
                  autoComplete="off" 
                  className="validate center-align"
                  type="number" step="0.01" name="currentWeight" unit="kgs"
                  value=""/>
    

    【讨论】:

      猜你喜欢
      • 2018-11-30
      • 2020-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-30
      • 2019-07-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多