I know that Mobile Safari won't fire events while in "momentum" (-webkit-overflow-scrolling: touch;) scrolling. But this is not entirely the same thing, because Safari handles the (blinking) caret of an input internally.
<div id="container">
<input type="text" />
<div class="filling"></div>
</div>
#container {
position: absolute;
top: 20px;
bottom: 20px;
width: 50%;
-webkit-overflow-scrolling: touch;
overflow-y: auto;
border: 1px solid black;
}
input {
margin-top: 60vh;
}
.filling {
height: 200vh;
}
Try this fiddle on your device (focus the input and then scroll): https://jsfiddle.net/gabrielmaldi/n5pgedzv
The issue also happens when you keep your finger pressed (i.e. not only when giving it momentum and releasing): the caret fails to scroll.
Obviously I don't want to turn off overflow scrolling, if there's no way to fix the caret so it will scroll correctly, it would be OK to hide it.
Thanks
Use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. The speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. Also creates a new stacking context.
This means that you cannot use webkit-overflow-scrolling:touch in PhoneGap apps, and for most other use cases at this time. Instead you can use overflow: scroll, but that's only supported in Android 3.0+, so use iScroll, or the many other alternatives out there.
This is indeed a WebKit bug and there seems to be no known workaround.
@cvrebert filed the bug:
Had this same problem, my fix was altering between
-webkit-overflow-scrolling: touch
and
-webkit-overflow-scrolling: auto
whenever i focus/blur on inputs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With