My issue is quite straightforward. I have a <Tooltip>
component wrapping a <Select>
component, and when I click the Select, the tooltip appears above the MenuItems like this:
Expected behavior:
https://i.sstatic.net/VOVmf.png
Unexpected behavior:
https://i.sstatic.net/yGEPk.png
I kept all the default values for Material-UI, and for the Tooltip it's: zIndex: 1500
, but there isn't one for MenuItem as far as I can tell. I tried setting the zIndex of MenuItem to 1501, but the behavior remained the same.
I am curious about the correct way to either position the tooltip behind the MenuItem or hide the tooltip altogether when the Select MenuItems are displayed...
Below is a snippet of my code:
<Tooltip title={'Filter by status'}>
<Select value={this.state.status} onChange={this.handleChange.bind(this, Filter.Status)}>
{statuses.sort(this.filterItemSortFn).map(item => {
return (<MenuItem style={{zIndex: 1501}} value={item}>{item}</MenuItem>);
})}
</Select>
</Tooltip>
If I decrease the zIndex of the tooltip so that it hides behind the MenuItems, it works, but I prefer not to override default values as it may impact other zIndex settings.
You can access the CodeSandbox demonstration here: https://codesandbox.io/s/rn68z4xlo