Skip to content

Commit 53371d5

Browse files
authored
Merge pull request #3262 from torkelo/menu-scroll-into-view-issue
Fix for Menu bottom is scrolled into view even when menuShouldScrollIntoView=false
2 parents 41118ca + 7a414a7 commit 53371d5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/fair-panthers-marry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-select": patch
3+
---
4+
5+
The Menu bottom is no longer scrolled into view when menuShouldScrollIntoView=false

packages/react-select/src/components/Menu.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,9 @@ export function getMenuPlacement({
145145

146146
// BOTTOM: allow browser to increase scrollable area and immediately set scroll
147147
if (placement === 'bottom') {
148-
scrollTo(scrollParent, scrollDown);
148+
if (shouldScroll) {
149+
scrollTo(scrollParent, scrollDown);
150+
}
149151
return { placement: 'bottom', maxHeight };
150152
}
151153
break;

0 commit comments

Comments
 (0)