react-select icon indicating copy to clipboard operation
react-select copied to clipboard

z-index issue when other components use bootstrap input-group and form-control class

Open adirima-paix opened this issue 10 years ago • 26 comments

Hi there,

We recently had an issue with the z-index of the dropdown because other components on the page where using these 2 classes:

.input-group.form-control

and this has a z-index of 2 while the Select-menu-outer class has a z-index of 1 which caused the dropdown being shown below the other input fields.

We managed to go around this by overriding the css class with another class and apply it to a div wrapper. However, maybe it would be better to increase z-index in the Select-menu-outer class in order to avoid other people having the same issue.

Cheers, Adriana

adirima-paix avatar Jul 07 '16 11:07 adirima-paix

+1

I just made the same change because I have a react-select control in a react-bootstrap panel, and immediately below the react-select control is a react-bootstrap ListGroup. With react-bootstrap, the select ListGroupItem has a z-index of 2, meaning that it sits on top of anything styled with .Select-menu-outer. I would recommend setting the z-index of Select-menu-outer to at least 5 by default...

ewittle avatar Jul 08 '16 21:07 ewittle

+1

ufukomer avatar Jul 14 '16 14:07 ufukomer

+1

wmcmeans avatar Aug 07 '16 01:08 wmcmeans

+1

davejacksonesc avatar Oct 13 '16 08:10 davejacksonesc

An alternate workaround, avoiding CSS changes, is to use menuContainerStyle i.e. <Select ... menuContainerStyle={{ zIndex: 5 }} /> https://github.com/JedWatson/react-select/blob/master/src/Select.js#L76 https://github.com/JedWatson/react-select/blob/master/src/Select.js#L1023

andrewdushane avatar Oct 13 '16 20:10 andrewdushane

anyone solved this problem? menuContainerStyle={{ zIndex: 5 }} not work.

evgeniiteterin avatar Feb 13 '17 15:02 evgeniiteterin

Hi I have a same problem with dropdown styling ? and also the zIndex:5 is not working.

Im using Material-UI for the table row

screen shot 2017-02-21 at 5 36 45 pm

michaelroevievictoria avatar Feb 21 '17 09:02 michaelroevievictoria

See prateekjahead's comment: https://github.com/JedWatson/react-select/issues/1010 "HubSpot's react-select-plus takes in dropdownComponent as a prop which solves the issue."

turnerniles avatar Mar 05 '17 18:03 turnerniles

I have the same issue: menuContainerStyle={{ zIndex: 5 }} doesn't work, react-select-plus doesn't work..

anikakalbrun avatar Apr 25 '17 13:04 anikakalbrun

.Select-menu-outer {
    z-index: 1000;
  }

worked for us

DeeLindesay avatar May 02 '17 16:05 DeeLindesay

Hi, small update on my own soluiton (far from perfect but hey...)

                      <Select
                        placeholder="-  Sélectionner un club ou coach  -"
                        name="coachName"
                        value={searchOptions.coachs.filter(coach => coach.active)}
                        options={searchOptions.coachs}
                        onChange={coachs => this.setCoachs(coachs)}
                        onOpen={() => this.setState({ coachSelectOpen: true })}
                        onClose={() => this.setState({ coachSelectOpen: false })}
                        multi
                      />
                      {this.state.coachSelectOpen ? <div><br /><br /><br /><br /><br /><br /><br /><br /></div> : null }

florentdestremau avatar Jun 08 '17 15:06 florentdestremau

I would recommend to just override the .Select-menu-outer styling. We would play an endless battle if someone needs it at 3, then 4.

agirton avatar Jun 09 '17 04:06 agirton

tried everything i could, no CSS styling would fix it. z-indexed all the html dom tree way up, nothing to do.. All the answers I saw did not work

florentdestremau avatar Jun 12 '17 08:06 florentdestremau

DeeLindesay's answer worked for me too. .Select-menu-outer { z-index: 1000; }

phwareboss avatar Jun 16 '17 12:06 phwareboss

still running into issue this tried everything suggested here, did we get a solid fix for this? Thanks!

brainloc avatar Oct 28 '17 03:10 brainloc

Had this issue with file upload fields. Here's how I fixed it. .input-group .form-control, .input-group-btn .btn { z-index: inherit !important; }

Would probably work for select fields too.

stanleyume avatar Oct 28 '17 20:10 stanleyume

.is-open { z-index: 100 !important; } This helped me solve the issue

phanimamilla avatar Nov 08 '17 12:11 phanimamilla

@stanleyume's answer worked for me. Input-groups with date picker. Tnx.

gil47 avatar Feb 27 '18 11:02 gil47

Not working for me either: classes are renamed by jss!

Anyone else managed to solve this?

damianobarbati avatar May 09 '18 08:05 damianobarbati

Surely this can be addressed in the actual component and not with a bunch of work-arounds?

andrewmclagan avatar Jun 13 '18 04:06 andrewmclagan