gpt4 book ai didi

reactjs - 如何在 react 选择下拉列表中更改zIndex

转载 作者:行者123 更新时间:2023-12-02 11:26:06 24 4
gpt4 key购买 nike

我正在使用react-select库创建自动完成下拉列表。
如果2nd有一些数据,我使用了2个下拉并行,并且我先打开了一个,然后出现zIndex问题。看到图像enter image description here

最佳答案

尝试这种设置z索引的方法,让我知道它是否有效:)

<Select
styles={{
// Fixes the overlapping problem of the component
menu: provided => ({ ...provided, zIndex: 9999 })
}}
value={selectedOption}
onChange={evt => onSelectChange(evt, index)}
options={options}
/>

关于reactjs - 如何在 react 选择下拉列表中更改zIndex,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55830799/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com