You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across this issue when looking at #1529
It is unclear to me why this happens. For me, it happens in about 50% cases when the page loads from localhost, and never - when loading the demo site. I only tried it on Chrome, Windows 10.
The issue above has the following comment:
CodePen (TIMING DEPENDENT - may be hard to repro on a slow website with lots of external network fetches like CodePen. Repros reliably on my local demo server.)
The issue could be a result of how webpack works internally, or it could be a result of how browsers process script tags.
Regardless of the root of the problem, I believe the Text Field demo needs to be rewritten. It uses a <script>setTimeout(function(){//code using window.mdc object}, 0)</script>before the following script loads MDC library. This is not by any means how things should be done in production or development. Moving MDC script into <head> is one solution. Another one is to rely on document.addEventListener("DOMContentLoaded", () => {}) instead of setTimeout(()=>{}, 0). Or move everything to the bottom of the <body> but put the MDC library loader first.
The text was updated successfully, but these errors were encountered: