javascript - ReactJS IconButton 在 Firefox 中不起作用

标签 javascript reactjs onclick cross-browser material-ui

IconButton的点击功能来自Material UI不适用于任何版本的 FireFox 。这是我正在使用的代码:

<div className='floating-button visible-xs'>
  <IconButton touch={true} tooltipPosition="bottom-left">
    <Create className='floating-button-icon' onTouchTap={this.props.onProfileEdit}/>
  </IconButton>
</div>

有人知道如何解决这个问题吗?上面的代码在 Chrome 中 100% 工作。和Safari .

最佳答案

请使用 onClick 属性而不是 onTouchTap 并将其应用于 IconButton 组件本身而不是特定图标。

<div className='floating-button visible-xs'>
  <IconButton touch={true} tooltipPosition="bottom-left" onClick={this.props.onProfileEdit}>
    <Create className='floating-button-icon' />
  </IconButton>
</div>

关于javascript - ReactJS IconButton 在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51130473/

相关文章:

javascript - 删除javascript中的对象引用

javascript - 使用 JavaScript 将 HTML append 到 DOM

javascript - 如何在 Cypress 中获取所有特定按钮并单击具有特定数据 ID 的每个按钮

javascript - React Native - 如何在 View 上实现模式?

javascript - ReactJS中如何处理两个setState方法依次执行?

animation - 使用样式组件时将动画应用到 React 组件

java - 如何使用按钮更改图像并播放声音?

javascript - 文件上传后如何显示文件名

javascript - Egghead.io Redux 教程 - 第 17 课 : "TypeError: Cannot read property ' map' of undefined

javascript - 如何更正复选框并显示是否已选中