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

Buggy theme switching on Safari #5226

Closed
efroemling opened this issue Jun 29, 2023 · 3 comments
Closed

Buggy theme switching on Safari #5226

efroemling opened this issue Jun 29, 2023 · 3 comments
Labels
browser issue is related to a browser bug

Comments

@efroemling
Copy link

Describe the bug

I recently noticed that switching Ace themes on Safari seems a bit broken, whereas it was working cleanly a few months ago when I last tried it. I'm seeing the broken behavior on the latest Mac, iOS, and iPadOS Safari, but am not seeing it on other desktop browsers or on an older Safari running on the iPadOS 16 beta. So it seems like something broke recently with newer Safari versions. I'm curious if there is anything that can be addressed on the Ace end or if this should be filed as a Safari bug.

Expected Behavior

Switching themes repeatedly should work.

Current Behavior

Switching themes works correctly once, but the second time it seems to only partially switch, giving a broken looking jumbled theme. Clicking on the editor seems to kick-start things and finish the switch though.

Reproduction Steps

  • On a recent version of Safari (I'm using 16.5.1 on an M1 Mac) go to the Ace kitchen sink example at https://ace.c9.io/build/kitchen-sink.html
  • Switch the theme from the default TextMate to a dark theme such as Twilight. It should switch successfully.
  • Now switch the theme back to a light theme such as TextMate. The switch should only partially occur, giving dark text on a dark background.
  • Tapping/clicking the editor should cause it to refresh and show the TextMate theme properly again.

Possible Solution

No response

Additional Information/Context

No response

Ace Version / Browser / OS / Keyboard layout

Safari 16.5.1 shows the issue. Ace version does not seem to matter.

@nightwing
Copy link
Member

Interesting caching bug in safari.
I did not figure out what exactly triggers it, but doing the following after setting the theme seems to circumvent it.

setTimeout(function(){
    var x=editor.container.className;
    editor.container.className = "";
    editor.container.className = x
});

@efroemling
Copy link
Author

Thanks for the workaround. I also submitted a safari bug report just in case that gets noticed.

@akoreman akoreman added the browser issue is related to a browser label Oct 23, 2023
@akoreman
Copy link
Contributor

Given that this is a bug in safari where there is little we can do from our side, I'll go ahead an close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser issue is related to a browser bug
Projects
None yet
Development

No branches or pull requests

3 participants