mousemke / flounder

Style-able dropdown replacement for native dropdowns
MIT License
9 stars 10 forks source link

[Performance] Defer calling focus on flounder main div and search input #178

Closed conor-cafferkey-sociomantic closed 6 years ago

conor-cafferkey-sociomantic commented 6 years ago

Currently

Calling focus on the main Flounder div and on the flounder search input is very slow when we have a very large dataset ( ~12,000 options split into sections; tested in Chrome)

Problem

Flounder main div has thousands of child nodes so makes sense that this should be slow.

Not clear why focusing on the search input should be so slow...

Wanted

Use setTimeout to defer focusing on either one.

mousemke commented 6 years ago

i have not looked deeply into this issue, but to just share a nugget to keep in mind from similar issues, a lot of the focus trading is for accessibility reasons

conor-cafferkey-sociomantic commented 6 years ago

Since this is a fairly simple and low-risk change let’s implement as a quick perf win and release independently of the other performance improvements that will come later.