-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Don't cycle carousel when the page isn't visible #15566
Conversation
Improves performance when the page is in a hidden tab or minimized window, etc. Fixes #15298 as this happens to work around it by preventing the problematic situation from occurring.
This was one of the suggestions I had made in the past so I'm definitely for it 👍 |
Great idea 👍 |
I suggest this new behaviour should tie-into |
I'm having a hard time envisioning a case where it's desirable to slide things even when the user isn't watching them. If anyone has such a use case, please speak up. |
@cvrebert Carousel as news ticker, for example, like tweets and hash tags on current events. Moreover Carousel already has a Maybe Carousel pausing on visibility should use |
That seems relatively niche, but I'd be interested to hear the rest of the team's thoughts on it.
That leads to some questions around "What happens if the page explicitly calls |
I think it will be fine as long as we point out in the release notes that this changes the default behavior. |
@XhmikosR What's your opinion after StevenBlack's remarks? |
The use case @StevenBlack describes seems a valid one indeed. But, wasting power is never good, so I'm still in favor of this change as long as we do it in a major version bump. |
@cvrebert just kick me for being redundant but Carousel pausing on scroll should be configurable — default |
@StevenBlack Scrolling is a separate issue entirely. File a new bug if you care about it. |
Punting this to v4 then. |
This uses the Page Visibility API (when available) to stop cycling the carousel when the page is hidden (e.g. in an inactive tab, minimized window, etc.).
This seems like better UX and also improves perf when the page is hidden (browser has less work to do).
This also addresses #15298 by not sliding while the page is hidden in Chrome in the first place (thus preventing the problematic situation from occurring).