【问题标题】:materiul-ui buttons override modal window reactmaterial-ui 按钮覆盖模态窗口反应
【发布时间】:2017-08-09 09:00:43
【问题描述】:

如何禁用 materiul-ui 按钮 RaisedButton 的覆盖。

我有一个模态窗口,当我打开它时 - 按钮仍然显示。

我应该向按钮添加什么属性来禁用覆盖?

请谁使用material-ui,帮助。

画面如下

我尝试将 z-index 用于按钮的容器,但没有帮助

【问题讨论】:

  • 请添加一些相关代码

标签: css reactjs material-ui


【解决方案1】:

我在按钮上添加了z-indexposition,现在可以了。

 <div className={styles.watch__button}>
          <RaisedButton
            onClick={buttonRole}
            backgroundColor={timerButtonColor}
            style={{zIndex: 0, position: 'relative'}}>
            <div className={styles.watch__button__text}>{buttonName}</div>
          </RaisedButton>
        </div>
        <div className={styles.watch__button}>
          <RaisedButton
            onClick={this.handleShowCalendar}
            backgroundColor={genButtonColor}
            style={{zIndex: 0, position: 'relative'}}>
            <div className={styles.watch__button__text}>Generate</div>
          </RaisedButton>
        </div>
        <Modal
          isOpen={showCalendar} >
          <button onClick={this.handleShowCalendar}>close</button>
          <h1>Modal Content</h1>
        </Modal >

也许有人知道如何用类来制作它,因为它只适用于样式

【讨论】:

    猜你喜欢
    • 2020-06-28
    • 1970-01-01
    • 2014-02-02
    • 1970-01-01
    • 2019-02-02
    • 1970-01-01
    • 2021-01-17
    • 2020-10-23
    • 1970-01-01
    相关资源
    最近更新 更多