themesberg / themesberg/flowbite

When using the sidebar (drawer) it does not open/close on mobile if using Turbo

Open
#793 2 comments 0 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
Using Ruby on Rails with turbo_frames breaks navbar functionality in terms of the animation on mobile. Functionality to add/remove backdrop fails and cancels any more runs in JS. Need to reload the page for the functionality to come back up.

To Reproduce
Steps to reproduce the behavior:
Use the free Application https://flowbite.com/blocks/application/shells/#application-shell-with-sidebar-and-navbar and let the main area be a turbo-frame.
Navigate to a page on mobile
Try to open the drawer again
Error will be: "TypeError: Cannot read properties of null (reading 'remove')"

Expected behavior
I would expect the drawer to open

Desktop (please complete the following information):

  • OS: Sonoma
  • Browser Chrome
  • Version 120.0.6099.216
  • Mobile emulated in Chrome

Additional context
I am getting an error from index.ts:221
Possibly there are two backdrop elements created

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

Reproduce the issue with the Flowbite application shell, a Turbo frame, and mobile emulation, then inspect index.ts:221 and the drawer backdrop lifecycle. Done means the drawer can be opened and closed again after Turbo-frame navigation without the null remove error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, tailwindcss, typescript
Domain
frontend
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.