-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Prevent select element from flashing right before it's replaced #1782
base: main
Are you sure you want to change the base?
Conversation
… only way to accommodate noscript users
@@ -27,6 +27,7 @@ | |||
<link rel="alternate" href="/publications.rss" type="application/rss+xml" title="TASVideos RSS Publication Feed"> | |||
<link rel="alternate" href="/wiki.rss" type="application/rss+xml" title="TASVideos RSS Wiki Feed"> | |||
<partial name="_MetaTags" /> | |||
<script>document.head.appendChild(document.createElement("style")).innerHTML = '.d-none-js { display: none !important; }';</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively:
<script>document.head.appendChild(document.createElement("style")).innerHTML = '.d-none-js { display: none !important; }';</script> | |
<!-- can move to main stylesheet --><style>:root.supports-js .d-none-js { display: none !important; }</style> | |
<script>document.documentElement.classList.add("supports-js");</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I can't test right now) Have you tested whether that prevents the flashing on repeated reloading on the usual browsers on desktop and mobile?
It may look the same, but I noticed adding a <style> blocks cached rendering better than adding a css class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't (I also can't test atm)
I'm not sure i want this PR |
I'm converting this to a draft, I want to try out the suggested thing and some other stuff. If I can't find anything, I'll just close this. |
Look at this code, this feels very hacky.