【问题标题】:Material Ui and react-router onClick event delay in mobile devices移动设备中的 Material Ui 和 react-router onClick 事件延迟
【发布时间】:2019-01-06 18:09:33
【问题描述】:

我有一个带有 @material-ui/core v.1.2.1 和 react-router 3.0.2 的反应应用程序(目前我无法更新它)。当我单击一个处理导航的按钮时,需要 2 秒才能工作。

我已添加到我的 index.html 以避免 onClick 事件延迟。

Material ui 的文档谈到了how to deal with third-party routing libraries,但我的按钮在导航之前需要一些逻辑,所以我不能使用这个解决方案。有什么建议吗?

【问题讨论】:

    标签: javascript reactjs events react-router


    【解决方案1】:

    还没有尝试过,但我知道这个包应该通过 React 修复 onClick 在移动设备上的点击延迟:https://github.com/zilverline/react-tap-event-plugin

    【讨论】:

      【解决方案2】:

      FastClick for React 为我修复了它。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-06-13
        • 2020-09-28
        • 2021-02-07
        • 1970-01-01
        • 2020-11-18
        • 1970-01-01
        • 2017-01-23
        • 2015-07-05
        相关资源
        最近更新 更多