Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

With the new Navigation API, you can now show the native spinner + stop button for any asynchronous operation - all you need is a Promise.

332,184 Aufrufe • vor 3 Jahren •via X (Twitter)

10 Kommentare

Profilbild von sam "zero​width​space" thor
sam "zero​width​space" thorvor 3 Jahren

I've been doing this for years!

Profilbild von Jason Miller 🦊⚛
Jason Miller 🦊⚛vor 3 Jahren

isn't there an iframe version of this approach as well? I seem to recall doing the opposite (using a hidden iframe for <form> post) decades ago, and being annoyed that the loading spinner kept toggling on/off.

Profilbild von Thomas Shaddox
Thomas Shaddoxvor 3 Jahren

More about this here:

Profilbild von Domenic Denicola
Domenic Denicolavor 3 Jahren

@mathias I'm a little worried about the accessibility announcement this will generate... Maybe it's fine if you're largely using it for full-page effects that deserve a "loading" announcement anyway?

Profilbild von Andreas Finger
Andreas Fingervor 3 Jahren

Please only do this with sufficient delay (300ms or so) to allow for most round-trips on a good connection to resolve before showing the spinner on every click! Otherwise your page will feel slower and somehow broken.

Profilbild von Gustavo
Gustavovor 3 Jahren

Now let’s wait for Safari as it’s not polyfillable 🙃

Profilbild von Éliette 🏳️‍⚧️ @elipriaulx.bsky.social
Éliette 🏳️‍⚧️ @elipriaulx.bsky.socialvor 3 Jahren

@noseratio Is there a chance you could click the 'stop loading' button a fraction too late and inadvertently refresh the page?

Profilbild von Robert Vitonsky
Robert Vitonskyvor 3 Jahren

Wow, it's disgusting. Now user even can't be sure the cause of appearing of this spinner. Because it may be because resources still loading (default behavior) or maybe some developer enable it just for fun or due to bug

Profilbild von Ricardo B�nffy -
Ricardo B�nffy -vor 3 Jahren

I can't avoid hating this idea - the spinner and everything outside the page belongs to the browser user and needs to reflect the browser's state. These UI elements need to be trusted by the user and making them accessible this way to code on the page breaks that trust.

Profilbild von Ryan Rampersad
Ryan Rampersadvor 3 Jahren

very cool

Ähnliche Videos