React-select: Clicking outside the browser dismisses menu

Created on 30 Apr 2018  Â·  7Comments  Â·  Source: JedWatson/react-select

I'm trying to debug what is going on inside this component, when the menu is up, but clicking outside of the browser, such as into the chrome debugger, closes the menu. Right clicking "Inspect" inside the menu also causes a close, and causes the inspector to go to the element that would be below the menu. (edit: this is in v2, which i just realized i have)

Most helpful comment

nice, what I did was to hardcode the prop menuIsOpen

All 7 comments

Same on v1, how can we inspect the menu elements (for development purposes)?

If you locate the <Select ... /> element in the dom inspector, you can add a breakpoint to its parent element. That way, if the menu tries to close, it would be stuck in a debugger state in which you would still be able to inspect the dom element. Steps to inspect actual menu while it is open:

Inspect around the elements and/or parent of the menu element, right-click → "Break on" → "subtree modifications"

image

Well, good to learn about some debugging features I wasn't aware of, so thank you for that. I still find it slightly strange, that the menu closes when clicking outside the browser. Though maybe I'm wrong.

What I really wanted to do was dig into it with the menu open and displaying, so that I can figure out what tweaks I need to make to the styles all the way around to get it to display over everything else.

I'm hoping that V2 would have a few options that would affect it's defaults? 1- a way to draw over the top of everything, 2- a way to forcefully expand the parent of the Select . . . there was a 3rd possibility i had thought of yesterday and can't remember now that i'm posting about it. Anyway, that seems like it's the most encountered, and least easily solved reliably problem that I've seen while digging thru the tracker here.

nice, what I did was to hardcode the prop menuIsOpen

@canda just add that prop to the .

issue closed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AchinthaReemal picture AchinthaReemal  Â·  3Comments

sampatbadhe picture sampatbadhe  Â·  3Comments

yrabinov picture yrabinov  Â·  3Comments

steida picture steida  Â·  3Comments

geraldfullam picture geraldfullam  Â·  3Comments