【问题标题】:How to show Tooltip only onClick in react toolbox如何在反应工具箱中仅显示工具提示 onClick
【发布时间】:2018-01-22 18:51:04
【问题描述】:

react-toolbox 官方文档中有一个Tooltip example。如何在输入上仅显示工具提示 onClick 事件。

【问题讨论】:

  • 参考文档,tooltipShowOnClick 属性没用?

标签: reactjs react-toolbox


【解决方案1】:

如果您不想在鼠标输入时显示工具提示,您应该分叉项目并进行以下更改:

at components/tooltip/Tooltip.js:

handleMouseEnter = (event) => {
        this.activate(this.calculatePosition(event.currentTarget));
        if (this.props.onMouseEnter) this.props.onMouseEnter(event);
      };

handleMouseLeave = (event) => {
        this.deactivate();
        if (this.props.onMouseLeave) this.props.onMouseLeave(event);
      };

handleMouseEnter = (event) => {
        return false;
      };

handleMouseLeave = (event) => {
        return false;
      };

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-14
    • 2021-09-10
    • 1970-01-01
    • 2022-06-24
    • 2017-06-02
    • 2023-03-28
    • 2023-02-02
    相关资源
    最近更新 更多