2017-08-09 19 views
0

如何禁用材料按鈕覆蓋RaisedButtonmateriul-ui按鈕覆蓋模態窗口反應

我有一個模式窗口,當我打開它 - 按鈕仍然顯示。

我應該向我的按鈕添加什麼屬性來禁用疊加?

請誰與material-ui一起工作,幫忙。

屏幕是波紋管enter image description here

我試圖用的z-index爲按鈕的容器,但並沒有幫助

+0

請添加一些相關的代碼 –

回答

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 >

也許有人知道如何帶班做它,因爲它僅適用於風格