简体   繁体   English

如何在React Toolbox中仅显示工具提示onClick

[英]How to show Tooltip only onClick in react toolbox

There is a Tooltip example in react-toolbox offical docs. react-toolbox官方文档中有一个工具提示示例 How can i show Tooltip only onClick event on Input. 如何在Input上仅显示工具提示onClick事件。

If you don't want to show tooltip on mouse enter, you should fork the project and make following changes: 如果不想在鼠标输入时显示工具提示,则应分叉该项目并进行以下更改:

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);
      };

TO

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM