实现了模态窗口,但它占据了整个屏幕而不是特定的部分。这是我的代码段
constructor(props) {
super(props);
this.state = { items: generateData() };
this.openModal = this.openModal.bind(this);
this.afterOpenModal = this.afterOpenModal.bind(this);
this.closeModal = this.closeModal.bind(this);
}
toggleEditIndustryPopup() {
this.setState({
showEditIndustryPopup: !this.state.showEditIndustryPopup
});
}
openModal() {
this.setState({ modalIsOpen: true });
}
closeModal() {
this.setState({ modalIsOpen: false });
}
<a rel="tooltip"
className="btn btn-info btn-simple btn-xs"
data-original-title="View Profile"
onClick={this.openModal}>
<i className="fa fa-edit"></i>
</a>
<Modal
isOpen={this.state.modalIsOpen}
onAfterOpen={this.afterOpenModal}
onRequestClose={this.closeModal}
> <EditIndustryPopup />
</Modal>
EditIndustryPopup显示了一些组件,例如标签,文本字段等, 所有组件都在显示,但是模式占据了整个屏幕。但是我需要在屏幕的中心(如弹出窗口)而不是整个屏幕上显示模态 谁能帮我