themesberg / themesberg/flowbite

Carousel component stops working when navigating back to page in Astro with View Transitions

Open
#864 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
9.4k
Forks
862
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I am using the carousel component in my Astro project with View transition and all works fine on the first page load. When I navigate to another page and back to this page, the carousel does not work. I see the messages fired by OnChange event , as I put it on cycle. However, on looking at the HTML the elements remain hidden and I see no change.

To Reproduce
Steps to reproduce the behavior:

  1. Use the carousel component in any page
  2. Navigate to another page and back
  3. The carousel component is not shown

Expected behavior
The carousel component should work the same as on the first page load as on subsequent page loads

Screenshots
First page load
Screenshot 2024-04-22 at 8 06 39 PM

Navigating to another page and back
Screenshot 2024-04-22 at 8 06 57 PM

Desktop (please complete the following information):

  • OS: Mac
  • Browser : Arc
  • Version : Chromium Engine Version 124.0.6367.61

Additional context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the carousel issue in an Astro page using View Transitions: load the page, navigate elsewhere, and return. Inspect the carousel HTML and compare the first load with the subsequent load; done means the carousel is visible and behaves the same after returning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, tailwindcss
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.