Skip to content

Commit 8f1a6d7

Browse files
committed
Completely hide empty layers on iOS to work around a rendering bug
FIX: Work around a rendering bug in Mobile Safari by completely hiding empty layers. Closes codemirror/dev#1600
1 parent b7c8f63 commit 8f1a6d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/layer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {Direction} from "./bidi"
55
import {BlockType} from "./decoration"
66
import {BlockInfo} from "./heightmap"
77
import {blockAt} from "./cursor"
8+
import browser from "./browser"
89

910
/// Markers shown in a [layer](#view.layer) must conform to this
1011
/// interface. They are created in a measuring phase, and have to
@@ -284,6 +285,8 @@ class LayerView {
284285
old = next
285286
}
286287
this.drawn = markers
288+
if (browser.ios) // Issue #1600
289+
this.dom.style.display = this.dom.firstChild ? "" : "none"
287290
}
288291
}
289292

0 commit comments

Comments
 (0)