stevengharris/MarkupEditor

Screen flash in dark mode

sundancecloud opened this issue · 3 comments

Hi,

MarkupEditor is handling dark mode quite well.

There is however a brief screen flash when the editor view is first opened. This appears on Mac(Catalyst), but does not seem to occur on iOS.

I think the cause is WKWebView showing a white background before MarkupEditor has a chance to load content.

As an interim fix, the following lines seem to eliminate the screen flash:

private func initForEditing() {
        self.isOpaque = false
        self.backgroundColor = UIColor.clear

File: MarkupWKWebView.swift

Thank you! I am back to cleaning up some MarkupEditor issues and will check this out and fold it in.

Hi @sundancecloud. The .clear for background in MarkupWKWebView looked fine in the demo, but when I consumed it in my project, it was a problem. I changed it to .systemBackground, which fixed it for me and eliminates the flash in the demo. I will be merging #150 with that change. Let me know if you see any issue.

HI @stevengharris, thanks for the update. I am running with the .systemBackground change and no problems to report. Looks good.