Skip to content

Commit eacb7f2

Browse files
committed
fix: ios13 safari z order bug.
1 parent 2e7e4c6 commit eacb7f2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Painter.js

+8-2
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,16 @@ function doClip(clipPaths, ctx) {
8080
function createRoot(width, height) {
8181
var domRoot = document.createElement('div');
8282

83-
// domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
83+
// domRoot.onselectstart = returnFalse; // Avoid page selected
8484
domRoot.style.cssText = [
8585
'position:relative',
86-
'overflow:hidden',
86+
// IOS13 safari probably has a compositing bug (z order of the canvas and the consequent
87+
// dom does not act as expected) when some of the parent dom has
88+
// `-webkit-overflow-scrolling: touch;` and the webpage is longer than one screen and
89+
// the canvas is not at the top part of the page.
90+
// Check `https://bugs.webkit.org/show_bug.cgi?id=203681` for more details. We remove
91+
// this `overflow:hidden` to avoid the bug.
92+
// 'overflow:hidden',
8793
'width:' + width + 'px',
8894
'height:' + height + 'px',
8995
'padding:0',

0 commit comments

Comments
 (0)