【问题标题】:Material UI - Button doesn't work over another componentMaterial UI - 按钮在另一个组件上不起作用
【发布时间】:2018-06-27 19:40:35
【问题描述】:

按钮的样式如下:

floatButton: {
    position: 'fixed',
    bottom: theme.spacing.unit * 2,
    right: theme.spacing.unit * 2
}

按钮组件看起来像:

<Button
  className={classes.floatButton}
  variant="fab"
  color="secondary"
  onClick={this.handleHideElement}
>
  <AddIcon />
</Button>

当浏览器窗口很小并且无法单击按钮时会出现问题:

enter image description here

由于某种原因,按钮有点透明,onClick 功能不起作用。

我该如何解决这个问题?

谢谢。

【问题讨论】:

标签: reactjs material-ui


【解决方案1】:

尝试让按钮的 z-index 高于其他所有按钮。这应该使它可点击并摆脱透明度。

【讨论】:

    猜你喜欢
    • 2017-06-15
    • 2021-01-28
    • 2017-12-13
    • 2016-12-26
    • 1970-01-01
    • 2016-06-15
    • 2017-10-13
    • 2022-01-09
    • 1970-01-01
    相关资源
    最近更新 更多