themesberg / themesberg/flowbite
Rails Turbo Frames multiple backdrops issues
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:
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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