选择选项后下拉以增大其大小(反应)

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

我如何固定下拉菜单,即,在选择选项之后,如果选项长度很大,则下拉菜单会增加其大小。我不希望它增加,因为它会干扰它旁边的其他组件。

我的代码如下:

dropdown:{
     marginTop: 17,
     maxWidth: '120%'

     },
<Typography variant="h3" component="h3" style={{  marginBottom: 10}} gutterBottom>
           Region
      <div className={classes.dropdown}>
      <Dropdown
                options={this.state.regionList}

                onChange={this.handleRegionChange}
       />
      </div>
     </Typography>

reactjs dropdown
1个回答
0
投票

请同时使用width和maxWidth。例如:

dropdown:{
   marginTop: 17,
   maxWidth: '200px'
   width: '200px'
},
© www.soinside.com 2019 - 2024. All rights reserved.