themesberg / themesberg/flowbite

Rails Turbo Frames multiple backdrops issues

Open
#698 15 comments 1 reaction 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
When loading frame in rails with turbo it is initialising all components again which makes modals and drawers create multiple backdrops. It sometimes makes screen grey and you need to refresh the whole window.

It looks like this code is responsible for it. https://github.com/themesberg/flowbite/blob/main/src/index.turbo.ts#L31-L44
Instead of initialising only new components it initialise those which are already initialised again. And that makes multiple backdrops.

Removing it fixes the issue but it will stop initialising new components in turbo frames.

To Reproduce
Steps to reproduce the behaviour:
lazy turbo frame
Demo: https://github.com/WozniakMac/flowbite-issue-demo

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome
  • Version 118.0.5993.117

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

Read src/index.turbo.ts around lines 31-44 and reproduce the behavior with the linked flowbite-issue-demo using a Turbo Frame. Confirm that existing components are not initialized twice while newly loaded frame components still initialize, and verify that modals and drawers create only one backdrop.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.