perf: removed forced reflow ("layout thrashing") by executing choiceList.scrollTo(0) in a separate animation frame

This commit is contained in:
Philipp Eichhorn 2018-05-22 13:46:24 +02:00
parent d3a18e255b
commit 92e968462c

View file

@ -450,7 +450,7 @@ class Choices {
// Scroll back to top of choices list
if (this.config.resetScrollPosition) {
this.choiceList.scrollTo(0);
requestAnimationFrame(() => this.choiceList.scrollTo(0));
}
// If we have grouped options