popover的显示/隐藏原先是正常的,在popover组件中放置了一个下拉框后,点击下拉框进行选择时,popover自动隐藏,导致无法进行下一步操作。
下面是我的代码:
const content = (
<div style={{ width: '535px', padding: '20px 0px 0 15px' }}>
<Form layout="inline">
<FormItem label="请选择子菜单类型:"style={{ margin: '15px 0' }}>
{getFieldDecorator('projecttype', {initialValue: '1'})(
<Select style={{ width: '180px' }}>
<Option value="1">社区版</Option>
<Option value="2">工具版</Option>
</Select>
)}
</FormItem>
</Form>
{/*确定、取消按钮*/}
<div style={{ textAlign: 'right' }}>
<Button type="primary" onClick={ this.handleOk }>确定</Button>
<Button type="ghost" style={{ margin: '0 10px 0 20px' }} onClick={ () => {this.setState({ visible: false })} }>取消</Button>
</div>
</div>
)
return(
<Popover
content={ content }
trigger="click"
visible={this.state.visible}
onVisibleChange={this.handleVisibleChange}
>
<Button type="primary" onClick={this.showPopover}><Icon type="plus-circle-o" />添加子菜单</Button>
</Popover>
)
}
仅仅是在官方例子中加了个下拉框,就出现上述问题,请问要怎么解决
github有解决方案
https://github.com/ant-design...