-
-
Save tlancina/694e54d8c357834f6fc0681586cdb460 to your computer and use it in GitHub Desktop.
Minimal reproduction of scrolling issue in WKWebView on iOS 12.2 with `pointer-events: none` when using `-webkit-overflow-scrolling: touch`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" dir="ltr"> | |
<head> | |
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> | |
<style> | |
html, body { | |
width: 100%; | |
height: 100%; | |
} | |
body { | |
position: fixed; | |
} | |
.scroll-bug-container { | |
left: 0; | |
right: 0; | |
top: 20px; | |
bottom: 0; | |
position: absolute; | |
display: block; | |
overflow-y: scroll; | |
-webkit-overflow-scrolling: touch; | |
} | |
</style> | |
<script> | |
function freeze() { | |
document.querySelector('.scroll-bug-container').style.backgroundColor = "gray"; | |
document.querySelector('.scroll-bug-container').style.pointerEvents = "none"; | |
setTimeout(() => { | |
document.querySelector('.scroll-bug-container').style.pointerEvents = ""; | |
}, 750); | |
} | |
function unfreeze() { | |
// triggering any style change causes normal scroll behavior to resume | |
document.querySelector('.scroll-bug-container').style.backgroundColor = ""; | |
} | |
</script> | |
</head> | |
<body> | |
<div class="scroll-bug-container"> | |
<button onclick="freeze()">Freeze</button> | |
<button onclick="unfreeze()">Unfreeze</button> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
<div>Item</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment