Display flaw with HTML input type number on iPhone iOS/Safari

前端 未结 4 2018
隐瞒了意图╮
隐瞒了意图╮ 2021-01-03 05:11

I want to use HTML input type=\"number\" on a mobile application, in order to indicate to the smarter mobile phones (Android, iPhone and some others), that the numeric keybo

4条回答
  •  南笙
    南笙 (楼主)
    2021-01-03 05:34

    I don't have access to the older iOS devices to test it but this works on modern iOS and at the same time Google Chrome has started to disobey width: as well, so this fixes both:

    input[type=number] {
      max-inline-size: none; /* chrome 71 */
      max-width: unset; min-width: unset; /* iOS12 */
    }
    

提交回复
热议问题