Prevent keyboard from popping on textbox focus/click in iPad webapps

后端 未结 7 1223
孤街浪徒
孤街浪徒 2021-02-08 10:36

I am trying to create a custom keyboard on an iPad application. But each time the input get the focus, the native iPad keyboard pops up. How can I prevent this, in JavaScript.

7条回答
  •  北荒
    北荒 (楼主)
    2021-02-08 10:49

    The best thing to do is to stop the event on the onclick event.
    html :

    
    

    Javascript :

    function myOnClickEvent(e){
    e.stopPropagation();
    }
    

    Dojo :

    function myOnClickEvent(e){
    dojo.stopEvent(e);
    }
    

    Sencha :

    function myOnClickEvent(e){
    e.stopEvent();
    }
    

    I hope this help.

提交回复
热议问题