themesberg / flowbite

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

Very bad performance of DropDown component #647

Open guratr opened 1 year ago

guratr commented 1 year ago

I noticed on my project that scrolls on comment page are very laggy, and found the DropDown component to be the problem. I tried striping everything else that may be causing this, but even for the most minimal setup the issue persist.

To Reproduce I just print plane html with php like this, with 100 components on page. dropDown.txt

<div>
    @for($i=0;$i<100;$i++)
        <div class="h-10">
            <button id="dropdownComment{{$i}}Button" data-dropdown-toggle="dropdownComment{{$i}}" type="button"></button>
            <div id="dropdownComment{{$i}}" class="hidden"></div>
        </div>
    @endfor
</div>

<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.8.1/flowbite.min.css"  rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.8.1/flowbite.min.js"></script>

Screenshots image

As you can see out of 1.63 s of scrolling, 991 ms spent on scripting.

Desktop

LukeGarrigan commented 11 months ago

Got the same issue, running a website with multiple components that have their own modals. The user can add as many rows as they wish, any more than 10 and the website is nearly unusable.

malikvogt commented 11 months ago

Got the same issue, running a website with multiple components that have their own modals. The user can add as many rows as they wish, any more than 10 and the website is nearly unusable.

I noticed the same problem with ininite scroll and dynamic loaded content. I have an overload of eventlisteners from poppenjs, that is used by flowbite for dropdowns etc.. In my oppinion these performance issues should get a higher prio, because it makes my application nearly unusable.

PhilETaylor commented 8 months ago

i have over 2000+ small tooltips, a few modals, a few dropdowns (which is not unrealistic in a normal SaaS UI) and after page load there is a 1-2second and also a scrolling lag/refresh issue. :-(

Its got to the point now where i'm ripping out import('flowbite') and having to write my own JS :(