Skip to content

react select dropdown doesn't show on top with scrolling table #4052

@phungttran2018

Description

@phungttran2018

**I am working on an application where I have a scrolling table. Inside tablecell, I have react select dropdown. However, the dropdown will not display above the tablewrapper div. If i use a regular select component (<select), it will show above the table. Please see attachment.

On my code, it looks something like this. Note that this is just a short version of my code.**

styles ===>
` tableWrapper: {
maxHeight: 400,
overflow: 'auto',
width: '100%',
},

tableData.map(....... return ( this.setState({onScroll:false})}> ({ ...base, zIndex: 1400, position: 'absolute' }) }} // menuPortalTarget={document.body} value={value[i]} onChange={(element) => this.handleChange(element, index)} options={options} clearable={false} backspaceRemoves={false} isDisabled={!obj.checkBox} /> ) )
` **Key point here is If i use menuPortalTarget={document.body} there seem to be a bug where the menu Drop down is literally not follow the component when user is scrolling as shown in issue https://github.com//issues/3734. I tried to use like block scrolling as well but block scrolling also block the scrolling of my menu dropdown. zIndex for select component won't work with div that have overflow: auto. Meanwhile waiting for issue 3734 to be fix, I am wondering is there anything we can change in css where we can have the menu dropdown show as the highest priority and show it like the default select ?**

image
image

If you can;t see the code above, here is a screen shot. I am not getting used to git hub so it doesn't look format right on my side.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions