【问题标题】:How to align react-bootstrap modal relative to the button clicked如何相对于单击的按钮对齐 react-bootstrap 模式
【发布时间】:2020-08-31 06:53:26
【问题描述】:

我有一个 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
    }

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

This is my code sand box working code

【问题讨论】:

标签: javascript css reactjs bootstrap-modal react-bootstrap


【解决方案1】:

您应该将contentClassName 更改为dialogClassName

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

【讨论】:

  • 但这无助于显示与点击文本相关的模式
猜你喜欢
  • 2021-11-14
  • 2017-08-19
  • 2014-07-29
  • 1970-01-01
  • 1970-01-01
  • 2013-10-21
  • 1970-01-01
  • 2019-01-28
  • 2017-09-24
相关资源
最近更新 更多