Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Performance: multiple select triggers reflows #1361

Open
naltatis opened this issue Dec 18, 2015 · 1 comment
Open

Performance: multiple select triggers reflows #1361

naltatis opened this issue Dec 18, 2015 · 1 comment

Comments

@naltatis
Copy link

I noticed that the multiple-select significantly slows down performance because it forces the browser to recalculate the layout. On a page with many select elements the impact is huge and blocks the browser for quite a while.

I've compiled a plunker showing this effect:
http://plnkr.co/edit/DpBir51UqvBjR8hZzfsf?p=preview

ui-select

The calculation is triggered from the uiSelectMatch link function:

if($select.multiple){
    $select.sizeSearchInput();
}

When I comment out these lines the sample code gets rendered 3x faster.
ui-select-optimised

It does not seem to effect functionality. The size of the input does not change. Am I missing something here?

naltatis

naltatis added a commit to naltatis/ui-select that referenced this issue Dec 18, 2015
@naltatis naltatis changed the title performance: multiple select triggers reflows Performance: multiple select triggers reflows Dec 18, 2015
@wesleycho
Copy link
Contributor

The sizeSearchInput method could use a heavy dose of optimization - the code is extremely fishy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants