iphone keyboard not hiding when tapping the screen

后端 未结 7 1079
小鲜肉
小鲜肉 2021-02-07 00:06

I have an input field with number type


In normal browsers, I\'m typing some numbers and I\'m

7条回答
  •  花落未央
    2021-02-07 00:20

    I might possibly have a solution for your issue on iOS. My configuration is safari on iOS 8.3/5C.

    From my experiments it seems to me that body element in Safari/iOS is not receptive to any click events. I am not able to explain why but it seems so.

    So, what I have done is: put a wrapper div just inside body and allow it to receive the click.

    Main.html

    
    
    
    
    keyboard hide issue
    
    
    
    
    
    
        

    blur.html

    
    
    
    
    Blur iFrame
    
    
    
    
    
        

    In both files I am able to hide the keyboard just fine. Again, I don't know the underlying reason but do let me know if you aren't able to replicate the solution.

    I have not tried it on an iPad. Thanks ...

提交回复
热议问题