繁体   English   中英

如何相对于单击的按钮对齐 react-bootstrap 模式

[英]How to align react-bootstrap modal relative to the button clicked

我有一个 react-bootstrap-modal this ,我想相对于点击的按钮显示我的模态,我的 react-bootstrap-table 中有一个选项,所以当我点击该选项时,我正在显示我的模态,但它不是相对对齐。

  1. 我正在使用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>

在这里我分享最少的代码,

    .modal_l {
      width: 100px !important; it is not taking styling
    }

我想在右侧显示模态,点击附近

这是我的代码沙盒工作代码

您应该将contentClassName更改为dialogClassName

.modal_l {
  width: 100px !important;
  max-width: none !important;// set max-width, if needed. 
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM