Skip to content
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

[Bug]: Gallery, неверная работа looped с timeout при их одновременном использовании #5951

Open
kaspian122 opened this issue Oct 11, 2023 · 3 comments · Fixed by #5954

Comments

@kaspian122
Copy link

kaspian122 commented Oct 11, 2023

Описание

Если использовать параметр looped в связке с timeout то если переключить вкладку в браузере а потом вернуться назад то начинают отрабатывать все таймауты (автосмены) которые должны были произойти за это время

-На скриншоте то как мы используем галерею
-На видео работа карусели при возвращении на вкладку через 3 минуты


UPD: после фикса #5954 создали ещё задачу уже о версии v5.10.0.

Постоянно стал воспоизводиться баг что Gallery в режиме looped с timeout
<Gallery slideWidth="95%" align="center" timeout={15000} isDraggable looped showArrows>
при возвращении на давно открытую вкладку (порядка минут 5) начинает подряд переключать слайды

Шаги воспроизведения

Создать галерею <Gallery slideWidth="95%" align="center" timeout={15000} isDraggable looped showArrows>
и добавить в неё более 2 слайдов

Ожидаемое поведение

При возвращении нет быстрой прокрутки галереи и тамер для автопереключения слайдов запускается заново на текущем слайде

Скриншоты

2024-01-18.13.03.08.mov

Версия

5.9.1, v5.10.0

В каких браузерах воспроизводится проблема?

Chrome, Firefox

Шаги воспроизведения

  • использовать Gallery с параметрами looped и timeout (например timeout={3000})
  • открыть страницу с галереей (пока мы на ней все работает исправно)
  • переключить вкладку и подождать больше 3 секунд (значения в таймауте, для наглядности в несколько раз)
  • переключиться обратно на вкладку

или

Создать галерею <Gallery slideWidth="95%" align="center" timeout={15000} isDraggable looped showArrows>
и добавить в неё более 2 слайдов

Видим что галерея начинает подряд переключать слайды столько раз, сколько должно было быть переключений за время отсутствия на вкладке

Ожидаемое поведение

При возвращении нет быстрой прокрутки галереи и тамер для автопереключения слайдов запускается заново на текущем слайде

Скриншоты

image

2023-10-11.12.37.09.mov

Пример с воспроизведением

No response

@BlackySoul BlackySoul self-assigned this Oct 11, 2023
@BlackySoul BlackySoul added this to VKUI Oct 11, 2023
@BlackySoul BlackySoul added this to the v5.9.2 milestone Oct 11, 2023
@github-project-automation github-project-automation bot moved this to 🗃 Backlog in VKUI Oct 11, 2023
@BlackySoul BlackySoul moved this from 🗃 Backlog to 🔧 In progress in VKUI Oct 11, 2023
@BlackySoul BlackySoul linked a pull request Oct 11, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from 🔧 In progress to ✅ Done in VKUI Oct 11, 2023
@vkcom-publisher
Copy link
Contributor

v5.9.2 🎉

@SevereCloud SevereCloud reopened this Oct 27, 2023
@github-project-automation github-project-automation bot moved this from ✅ Done to 🔜 To do in VKUI Oct 27, 2023
@SevereCloud
Copy link
Contributor

Все еще воспроизводится

@egorprnn
Copy link
Contributor

egorprnn commented Oct 27, 2023

Стоит посмотреть на реализацию таймаута на основе requestAnimationFrame и дельты между двумя измерениями perfomance.now() - даже после переключения между вкладками получится получать всегда актуально значение прошедшего времени

@BlackySoul BlackySoul moved this from 🔜 To do to 🔧 In progress in VKUI Nov 8, 2023
@BlackySoul BlackySoul moved this from 🔧 In progress to ✅ Done in VKUI Nov 13, 2023
@BlackySoul BlackySoul moved this from ✅ Done to 👀 In Review in VKUI Nov 13, 2023
@BlackySoul BlackySoul moved this from 👀 In Review to 🔧 In progress in VKUI Nov 13, 2023
@BlackySoul BlackySoul modified the milestones: v5.9.2, v5.10.1 Jan 31, 2024
@github-project-automation github-project-automation bot moved this from 🔧 In progress to ✅ Done in VKUI Feb 8, 2024
@inomdzhon inomdzhon reopened this Feb 8, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to 🔜 To do in VKUI Feb 8, 2024
@BlackySoul BlackySoul moved this from 🔜 To do to 🔧 In progress in VKUI Feb 12, 2024
@BlackySoul BlackySoul modified the milestones: v5.10.1, v6.0.1 Feb 27, 2024
@SevereCloud SevereCloud removed this from the v6.0.1 milestone Mar 5, 2024
@SevereCloud SevereCloud added this to the v6.0.2 milestone Mar 5, 2024
@BlackySoul BlackySoul modified the milestones: v6.0.2, v6.0.3 Mar 29, 2024
@BlackySoul BlackySoul moved this from 🔧 In progress to ⛔️ Blocked in VKUI May 13, 2024
@SevereCloud SevereCloud modified the milestones: v6.0.3, v6.1.1 May 15, 2024
@BlackySoul BlackySoul removed this from the v6.1.1 milestone May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⛔️ Blocked
Development

Successfully merging a pull request may close this issue.

6 participants