我如何固定下拉菜单,即,在选择选项之后,如果选项长度很大,则下拉菜单会增加其大小。我不希望它增加,因为它会干扰它旁边的其他组件。
我的代码如下:
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>
请同时使用width和maxWidth。例如:
dropdown:{
marginTop: 17,
maxWidth: '200px'
width: '200px'
},