[英]How to align react-bootstrap modal relative to the button clicked
I have a react-bootstrap-modal this , I want to show my modal relative to the button clicked, I have an option in my react-bootstrap-table so when I clik on that option I am showing my modal, but it is not aligning relatively.我有一个 react-bootstrap-modal this ,我想相对于点击的按钮显示我的模态,我的 react-bootstrap-table 中有一个选项,所以当我点击该选项时,我正在显示我的模态,但它不是相对对齐。
I am using contentClassName
to override .modal-content
, I don't know but it is not working as expected我正在使用
contentClassName
来覆盖.modal-content
,我不知道,但它没有按预期工作
<Modal show={props.show} onHide={props.handleClose} contentClassName="modal_l" // this is I am doing to override aria-labelledby="example-custom-modal-styling-title"> <div className="container_modal_options"> <div className="heading">Heading</div> <div className="content">"content</div> </div> </Modal>
Here I am sharing minimal code,在这里我分享最少的代码,
.modal_l {
width: 100px !important; it is not taking styling
}
I want to show modal at the right side, near by click我想在右侧显示模态,点击附近
You should change contentClassName
to dialogClassName
.您应该将
contentClassName
更改为dialogClassName
。
.modal_l {
width: 100px !important;
max-width: none !important;// set max-width, if needed.
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.