-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathreact-select+5.8.0.patch
More file actions
23 lines (22 loc) · 1.22 KB
/
react-select+5.8.0.patch
File metadata and controls
23 lines (22 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff --git a/node_modules/react-select/dist/Select-49a62830.esm.js b/node_modules/react-select/dist/Select-49a62830.esm.js
index bed0849..c04fcb3 100644
--- a/node_modules/react-select/dist/Select-49a62830.esm.js
+++ b/node_modules/react-select/dist/Select-49a62830.esm.js
@@ -1760,6 +1760,9 @@ var Select = /*#__PURE__*/function (_Component) {
// ensure focus is on the Input when the menu opens
isFocused && menuIsOpen && !prevProps.menuIsOpen) {
this.focusInput();
+ if (!this.menuListRef) {
+ this.openMenu('first'); // the fix for @showdex/components/ui/Scrollable
+ }
}
if (isFocused && isDisabled && !prevProps.isDisabled) {
// ensure select state gets blurred in case Select is programmatically disabled while focused
@@ -1777,7 +1780,7 @@ var Select = /*#__PURE__*/function (_Component) {
// scroll the focused option into view if necessary
if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {
- scrollIntoView(this.menuListRef, this.focusedOptionRef);
+ requestAnimationFrame(() => scrollIntoView(this.menuListRef, this.focusedOptionRef));
this.scrollToFocusedOptionOnUpdate = false;
}
}