New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance: Drop down opening slow when repeated in NgFor #900
Comments
Yeh, the global click handler (one that is used to close dropdowns on the outside clicks) is to blame here. Normally it is not an issue since in an app you would have just a limited number of dropdowns. As you've noticed it isn't a common scenario so you might want to roll out your own version of the dropdown directive that is tailored to your needs. We are going to look at this scenario but not as an immediate priority. |
One of the potential solutions would be to have a global service that tracks outside clicks and registers all the dropdown directives (it could probably be also useful to track outside clicks for other directives - ex.: datepicker popups). Here is a sketch of the solution: http://plnkr.co/edit/LvmpFxzCSRjlZCNU8Osm?p=preview |
In the meantime, I'd probably recommend implementing some sort of virtual scrolling to avoid having that many elements rendered at once. It seems like wasteful performance to have that many elements rendered at once. |
Hello, I have a lot of card in card representing a tree of elements. Thank you, |
I found a way to improve the performance using the renderer and dynamically registering listener : http://plnkr.co/edit/SXEy855KQQQYXgjI5Fqc?p=preview |
thbt's solution is exactly what I was about to implement, before searching. Please accept his/her pr. |
@wesleycho Do you have any example of working virtual scroll for ng2? As far as I know, there is nothing solid and we all are waiting for angular/components#823 |
when is this going to be merged and released please? |
Are there any updates on this issue? Using ~30 dropdowns literally kills the app performance. |
I think Renderer2 should be used instead of the deprecated Rendererso that it should also work with the angular-universal approach and i suggest to use NgZone so that it runs completely outside of the angular change detection because the change detection is the performance killer here, not the event |
+1 I need a resolution for this issue please! |
+1 |
We should have it covered in one of the next releases. |
+1 |
Any news regarding this? |
nothing new on this? |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 |
Is there any update on this issue?! |
+1 |
2 similar comments
+1 |
+1 |
I'd like to just echo that it's not just thousands that will cause this issue, and not always bad UX that causes this issue. We have a tabular UI where each row has two dropdowns. I don't think 50 rows warrants implementing virtual scrolling, but that's 100 dropdowns and a noticeable delay (500ms or more). With 100-200 rows, it's unusuable. (edit: well that's embarrassing, I didn't realize I was commenting on ng-bootstrap rather than ngx-bootstrap, which I use. Well, I guess my point is probably still valid) |
Issue is being fixed by below work around for ngx-bootstrap dropdown.
|
The dropdown components open performance is affected by the # of other dropdown components on the page. I know this is not great UX, but I have a table of ~1000 items which have a dropdown component in one of the cells, similar to the example provided.
http://plnkr.co/edit/IsdAtHkPQ4FnF8kYaRGA?p=preview
ng-bootstrap version: alpha.8
The text was updated successfully, but these errors were encountered: