HTML Mobile -forcing the soft keyboard to hide

前端 未结 8 2092
时光说笑
时光说笑 2020-11-27 03:40

I am developing the front end site for a coupon company, and I have a page where the user only needs to input phone number and $$ spent. We came up with a fun on-screen keyb

8条回答
  •  孤街浪徒
    2020-11-27 04:22

    For further readers/searchers:

    As Rene Pot points out on this topic,

    By adding the attribute readonly (or readonly="readonly") to the input field you should prevent anyone typing anything in it, but still be able to launch a click event on it.

    With this method, you can avoid popping up the "soft" Keyboard and still launch click events / fill the input by any on-screen keyboard.

    This solution also works fine with date-time-pickers which generally already implement controls.

提交回复
热议问题