I'm using react-select and I'm customizing it,I didn't found an option to do this. Is there some workaround I can use to keep dropdown open when I'm styling it?
-
2github.com/JedWatson/react-select/issues/927. There might be some useful comments here.Yvo Linssen– Yvo Linssen2018-03-15 12:38:30 +00:00Commented Mar 15, 2018 at 12:38
-
16<Select menuIsOpen={true} ... /> works for me.user2809286– user28092862020-05-18 06:58:08 +00:00Commented May 18, 2020 at 6:58
12 Answers
In chrome, got to Elements > Event Listeners > open "blur" > with the mouse go to the right of where it is written "document", then you can see a button "Remove" > click on it
If you're using V2 there's a menuIsOpen prop you can use to keep the menu open at all times.
If you're using Chrome and you have the React Developer Tools plugin, you can inspect your component in the React tab of the console and manually toggle this property right from your browser. For V1, you can toggle the isOpen state to achieve the same behavior.
1 Comment
That's work for me:
menuIsOpen={true}
2 Comments
Simple hack goes this way
Run this command on your console open the menu and then wait for 5 seconds and the debugger will automatically be applied and screen will be freezed.
setTimeout(() => {debugger;}, 5000)
3 Comments
Beforehand I exec window.onkeydown = () => {debugger} in js console and after expanding the dropdown I click any key
It's important to keep developer tools open
1 Comment
2023 answer for Google Chrome:
You can enable "Emulate a focused page" by using Cmd/Ctrl + Shift + P in Chrome devtools and that won't blur the document if you use devtools. Very handy for debugging focus styles, focus handler, dialogs, popovers, dropdowns, etc.

1 Comment
You can use the menuIsOpen props. It was on the react-select documentation and it works!
Docs: https://react-select.com/props
Screenshot:

Comments
Maybe this could help:
<Select
ref={el => (this.selectRef =el)}
onBlur={() => {
setTimeout(
() =>
this.selectRef.setState({
menuIsOpen: true,
}),
50
);
}}
/>
1 Comment
By using the Chrome React extension, you can force the "isOpen" (v3: "menuIsOpen") state value to true on the Select component.
more info here: https://github.com/JedWatson/react-select/issues/927#issuecomment-313022873
Comments
Open dropdown and then right click on dropdown... it will drown a pop over and on inspector.. now you can work upon your dropdown.