flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

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

Open Doddlin opened this issue 1 year ago • 2 comments

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

Doddlin avatar Jan 31 '24 14:01 Doddlin

I can't reproduce that problem, but I guess this most likely is a known bug, which should already be fixed (See https://github.com/themesberg/flowbite/pull/751, https://github.com/themesberg/flowbite/pull/665, https://github.com/themesberg/flowbite/commit/292da5a6e75bfa2702e1f4ee8cdcb1e7ef58a05c)

Do you use version 2.2.1 or at least 2.0.0?

daniel-rikowski avatar Feb 05 '24 19:02 daniel-rikowski

Yeps, that makes sense, looks like it covers the same error. I am on 2.2.1.

Doddlin avatar Feb 06 '24 09:02 Doddlin