iOS web app: input ignores touch events

220 views Asked by At

I'm trying to disable page scrolling using

$('body').on('touchmove',function(e){e.preventDefault()});

In Safari everything works as expected but in fullscreen mode only input and textarea don't prevent scrolling and ignore any touch event. I think it started in iOS8.

Here's example:

<!doctype html>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name=viewport content='width=device-width'>    

<body ontouchmove="event.preventDefault()">    

<div>
    <p>Lorem ipsum dolor sit amet</p>
    <p>Lorem ipsum dolor sit amet</p>
    <p>Lorem ipsum dolor sit amet</p>
</div>    

<input value='Input'><br>
<textarea>Textarea</textarea><br>
<div contentEditable=true>Editable div</div><br>
<button onclick='location.reload()'>Reload</button>

Am I missing something?
Is it possible to prevent scrolling on touching <input>?

1

There are 1 answers

0
redon On BEST ANSWER

Seems that touchevents in a standalone web-apps launched from homescreeen are back with iOS 8.1.3 :-)