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

前端 未结 4 1892
隐瞒了意图╮
隐瞒了意图╮ 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 06:00

    Actually the questioner himself is very close to the answer as he knows it is the spinner 's fault, and luckily webkit allow users to control it by CSS:

    input[type="number"]::-webkit-outer-spin-button { display: none; }
    

    Source: REMOVE SPIN CONTROL ON INPUT TYPE=NUMBER IN WEBKIT

    Live demo: http://jsbin.com/aviram/5/

    Hope it help.

提交回复
热议问题