TimePicker 的 Z 索引

问题描述 投票:0回答:1

在我的应用程序中,我有一个用于设置事件数据的弹出窗口。这些数据之一是时间。为此,我使用 MUI 中的 DateTimePicker。

<Popup
                width={600}
                height={600}
                /../
            >
                <div className={"group"}>
                        <div className={"label1"}>Name</div>
                        <div className={"label2"}>
                            <FormControl>
                                <DesktopTimePicker

我遇到的问题是 TimePicker 的第二个弹出窗口仍然隐藏在第一个弹出窗口后面。我尝试将 z-index 更改为 10000,但这没有帮助。在浏览器中显示如下:

.css-1anqmj6-MuiPopper-root-MuiPickersPopper-root {
    z-index: 1300;
}

.MuiPickersPopper-root {
    z-index: 10000;
}

这是否意味着我无法覆盖该值?

这是我的CSS:

.MuiPickersPopper-root {
    z-index: 10000; !important;
}

.group {
    display: flex;
    margin: 0.6em;
    align-items: center;
    flex-direction: row;
}

.group .label1 {
    display: inline-block;
    width: 25%;
}

.group .label2 {
    display: inline-block;
    width: 75%;
}
css types material-ui
1个回答
0
投票

几个小时后我发现了问题——索引后面的分号必须删除:

z-index: 10000 !important;

© www.soinside.com 2019 - 2024. All rights reserved.