3 回答

TA贡献2080条经验 获得超4个赞
您需要为自动完成容器提供绝对和 z-index 样式
添加这个CSS -
.autocomplete-dropdown-container{
position: "absolute";
z-index: 1000;
}
编辑:我使用的 css 有效-
.location-search-input,
.location-search-input:focus,
.location-search-input:active {
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.16), 0 0 0 1px rgba(0,0,0,0.08);
border: honeydew;
display: block;
width: 100%;
padding: 16px;
font-size: 16px;
border-radius: 2px;
outline: none;
}
.autocomplete-dropdown-container {
border-bottom: honeydew;
border-left: honeydew;
border-right: honeydew;
border-top: 1px solid #e6e6e6;
box-shadow: 0 2px 4px rgba(0,0,0,0.2);
position: absolute;
z-index: 1000;
border-radius: 0 0 2px 2px;
}

TA贡献1848条经验 获得超10个赞
您可以尝试将其绝对定位 - 如下所示:
styles={{
listView:{
position: 'absolute',
backgroundColor: '#FFF',
zIndex: 10,//Forcing it to front
}
}}

TA贡献1804条经验 获得超8个赞
您需要设置绝对位置和 zIndex
className="autocomplete-dropdown-container"
styles={{
listView:{
position: 'absolute',
backgroundColor: 'white',
zIndex: 2,
}
}}>
添加回答
举报