Status Chart: Fix mobile Safari#2975
Merged
StephanTLavavej merged 5 commits intomicrosoft:gh-pagesfrom Aug 3, 2022
Merged
Conversation
strega-nil-ms
approved these changes
Aug 3, 2022
02cd975 to
cb268dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My previous PR #2967 which attempted to address #2963 appeared to solve the problem for desktop Chrome, but broke mobile Safari such that the charts wouldn't even load.
I don't understand the root cause, but I suspect that it has something to do with how es-module-shims has to do actual work for mobile Safari (so perhaps the window is considered "loaded" before the JS finishes executing, and the
addEventListenerdid nothing).This PR uses a different technique that appears to work reliably in both environments. Now I run a function,
check_css(), that detects whether Primer CSS has loaded. If it hasn't, we'll wait 50ms and check again. (Chosen semi-arbitrarily - we don't need to check every frame, but we do want to notice it quickly.)This also updates dependencies slightly, including the Node version mentioned in the README.
As usual, this contains a "DROP BEFORE MERGING: Regen
built/status_chart.mjs." commit to make the live preview work.📉 📱 Live preview: stephantlavavej.github.io/STL/