mirror of
https://github.com/Choices-js/Choices.git
synced 2026-03-18 08:29:51 +01:00
Fix opening the dropdown could cause the entire page to scroll
This commit is contained in:
parent
095ecb3589
commit
2ebef172db
1 changed files with 2 additions and 2 deletions
|
|
@ -527,8 +527,8 @@ class Choices {
|
|||
);
|
||||
|
||||
if (activeElement !== null && !isScrolledIntoView(activeElement, this.choiceList.element)) {
|
||||
// We use the native scrollIntoView function instead of choiceList.scrollToChildElement to avoid animated scroll.
|
||||
activeElement.scrollIntoView();
|
||||
// scrollIntoView can cause entire page scrolling, scrollToChildElement causes undesired animation
|
||||
this.choiceList.element.scrollTop = activeElement.offsetTop;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue