flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

Flowbite not working on chromium based browsers.

Open Sarthak001 opened this issue 1 year ago • 9 comments

Describe the bug Flowbite components (modals,dropdown) not working on chromium based browsers.

To Reproduce Steps to reproduce the behavior:

  1. Setup a react project using official flowbite react setup [Using vite]
  2. make modal and dropdown components.
  3. deploy the app
  4. Modals and dropdown works on Firefox, but in Chromium it stays unresponsive(nothing happens)

Expected behavior Should be able to interact with flowbite's components (dropdown,modal)

App Setup Screenshots Screenshot from 2023-03-28 11-37-07 Screenshot from 2023-03-28 11-36-19 Screenshot from 2023-03-28 11-36-06

Desktop (please complete the following information):

  • OS: Linux
  • Browser Chromium and Firefox
  • Version Chromium Version 111.0.5563.64 and Firefox Version 111.0

Additional context By default flowbite's components (modals,dropdown) don't work on Firefox. To make it work on Firefox either we needed to add a import 'flowbite' statement under main.jsx (screenshot attached) or add script tag of the flowbite.js file in index.html (screenshot attached).

In tailwind.config.cjs - flowbite/plugin show this

module "/somepath/somepath/Projects/ssh-frontend/node_modules/flowbite/plugin"
Could not find a declaration file for module 'flowbite/plugin'. '/somepath/somepath/Projects/ssh-frontend/node_modules/flowbite/plugin.js' implicitly has an 'any' type.
  If the 'flowbite' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'flowbite/plugin';`ts(7016)

Sarthak001 avatar Mar 28 '23 06:03 Sarthak001

same here. Dropdown and mobile toggle button is not working in chrome

aknahin avatar Apr 01 '23 14:04 aknahin

any potential fix for this ?

Sarthak001 avatar Apr 16 '23 09:04 Sarthak001

Today i checked the bug. It started working on Chromium. Should i close this ticket ?

Sarthak001 avatar Apr 23 '23 18:04 Sarthak001

For me it's not working so I'd keep it open. It indeed works fine in Firefox!

javissimo avatar Apr 28 '23 20:04 javissimo

I fixed it by calling initFlowbite in App.jsx, its written in documentaiton to call initFlowbite() to initialize data properties required for dropdown,modal interaction

import { useState,useEffect } from 'react'
import './App.css'
import { initFlowbite } from 'flowbite'

function App() {
  const [count, setCount] = useState(0)
  useEffect(() => {
    initFlowbite();
  }, []);

return (<></>);
}

sudheersuri avatar Apr 29 '23 18:04 sudheersuri

I fixed it by calling initFlowbite in App.jsx, its written in documentaiton to call initFlowbite() to initialize data properties required for dropdown,modal interaction

import { useState,useEffect } from 'react'
import './App.css'
import { initFlowbite } from 'flowbite'

function App() {
  const [count, setCount] = useState(0)
  useEffect(() => {
    initFlowbite();
  }, []);

return (<></>);
}

This worked for me

yashptel avatar May 30 '23 06:05 yashptel

Sudheersuri's answer also fixed it for me with React. I feel this should be mentioned more prominently in the docs.

ClemensLey avatar Nov 03 '23 14:11 ClemensLey

I also have a problem with dropdowns on chromium based browsers.

I simply have a button in my navbar that toggles a dropdown with data attributes. Additionally, I have a second button in another responsive navbar for mobile view that also has a data dropdown toggle for the same dropdown menu.

This worked perfectly on all browsers until Flowbite v2.0.0, now it only works on non-chromium browsers.

How to use multiple buttons on the same dropdown? Maybe something has changed or I have missed something?

malikvogt avatar Dec 03 '23 10:12 malikvogt