Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen flash in dark mode #143

Closed
sundancecloud opened this issue Sep 29, 2023 · 3 comments · Fixed by #146 or #150
Closed

Screen flash in dark mode #143

sundancecloud opened this issue Sep 29, 2023 · 3 comments · Fixed by #146 or #150

Comments

@sundancecloud
Copy link

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

@stevengharris
Copy link
Owner

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

@stevengharris stevengharris linked a pull request Oct 4, 2023 that will close this issue
@stevengharris
Copy link
Owner

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.

@stevengharris stevengharris reopened this Oct 6, 2023
@stevengharris stevengharris linked a pull request Oct 6, 2023 that will close this issue
@sundancecloud
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants