mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-01 13:32:23 +02:00
perf: removed forced reflow ("layout thrashing") by executing choiceList.scrollTo(0) in a separate animation frame
This commit is contained in:
parent
d3a18e255b
commit
92e968462c
|
@ -450,7 +450,7 @@ class Choices {
|
||||||
|
|
||||||
// Scroll back to top of choices list
|
// Scroll back to top of choices list
|
||||||
if (this.config.resetScrollPosition) {
|
if (this.config.resetScrollPosition) {
|
||||||
this.choiceList.scrollTo(0);
|
requestAnimationFrame(() => this.choiceList.scrollTo(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have grouped options
|
// If we have grouped options
|
||||||
|
|
Loading…
Reference in a new issue