Загрузка видео...

Не удалось загрузить видео

На главную

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,195 просмотров • 3 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля sam "zero​width​space" thor
sam "zero​width​space" thor3 лет назад

I've been doing this for years!

Фото профиля Jason Miller 🦊⚛
Jason Miller 🦊⚛3 лет назад

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.

Фото профиля Thomas Shaddox
Thomas Shaddox3 лет назад

More about this here:

Фото профиля Domenic Denicola
Domenic Denicola3 лет назад

@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?

Фото профиля Andreas Finger
Andreas Finger3 лет назад

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.

Фото профиля Gustavo
Gustavo3 лет назад

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

Фото профиля Éliette 🏳️‍⚧️ @elipriaulx.bsky.social
Éliette 🏳️‍⚧️ @elipriaulx.bsky.social3 лет назад

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

Фото профиля Robert Vitonsky
Robert Vitonsky3 лет назад

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

Фото профиля Ricardo B�nffy -
Ricardo B�nffy -3 лет назад

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.

Фото профиля Ryan Rampersad
Ryan Rampersad3 лет назад

very cool

Похожие видео