themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.74k stars 727 forks source link

Dropdown and drawer components do not works when the table is paginated #699

Open alkadoHs opened 11 months ago

alkadoHs commented 11 months ago

I'm using data tables to enhance pagination, filtering and searching, but when the table is paginated the dropdowns and drawers of the next page stops to work and those on the first page works fine. I don't understand why this issue is happening.

zoltanszogyenyi commented 11 months ago

Hey @alkadoHs,

Did you make sure that the IDs of these dropdowns and modals are unique even across paginations?

Cheers, Zoltan

alkadoHs commented 11 months ago

Hey @alkadoHs,

Did you make sure that the IDs of these dropdowns and modals are unique even across paginations?

Cheers, Zoltan

Yes, they are unique, I'm looping through the data from the server and providing each modal and it's corresponding trigger button with unique id of the product. But it doesn't work 😔

zoltanszogyenyi commented 11 months ago

@alkadoHs what framework are you using?

alkadoHs commented 11 months ago

@alkadoHs what framework are you using?

Codeigniter, a PHP framework

zoltanszogyenyi commented 11 months ago

Do you have an example online somewhere? It's hard to guess why it wouldn't work.

Did you check the FlowbiteInstances object to see what's going on?

xujiongze commented 7 months ago

@zoltanszogyenyi Same problem Im using laravel10 + vue3 + inertia In inertia, using insted "This component is a light wrapper around a standard anchor link that intercepts click events and prevents full page reloads" And all page opened with Link, can't use offcanva(Drawer)

Solution for inertia:

import { router } from '@inertiajs/vue3'

router.on('success', () => { initFlowbite(); })

embarekmessai commented 6 months ago

@zoltanszogyenyi

Same problem Im using laravel10 + vue3 + inertia In inertia, using insted "This component is a light wrapper around a standard anchor link that intercepts click events and prevents full page reloads" And all page opened with Link, can't use offcanva(Drawer) Solution for inertia:

import { router } from '@inertiajs/vue3'

router.on('success', () => { initFlowbite(); })

Thank you, this helped me