If you use a Tooltip with an OverlayTrigger and specify show and hide delays, there is a way to keep the tool-tip open indefinitely, even after the cursor leaves the OverlayTrigger: Mouse over the trigger, wait for the tool-tip to appear, then rapidly click and drag mouse the cursor off the component. I was able to reproduce this behavior in Chrome, Firefox, and Internet Explorer.
This behavior can be demonstrated using the sample code from the documentation:
const LinkWithTooltip = React.createClass({
render() {
let tooltip = <Tooltip>{this.props.tooltip}</Tooltip>;
return (
<OverlayTrigger placement='top' overlay={tooltip} delayShow={300} delayHide={150}>
<a href={this.props.href}>{this.props.children}</a>
</OverlayTrigger>
);
}
});
Place this link anywhere, click and drag off the link quickly, and the tooltip will remain open.
I dove into the OverlayTrigger code a bit, and it seems the mouse click triggers a call to handleDelayedShow() (since that gives the wrapped component focus), which sets the _hoverDelay property. When handleDelayedHide() is invoked right after, it will just call clearTimeout(this._hoverDelay) and return, thus keeping the tooltip visible.
I think this behavior can be disabled by only specifying hover as a trigger. Perhaps focus should not be a default trigger?
If you use a
Tooltipwith anOverlayTriggerand specify show and hide delays, there is a way to keep the tool-tip open indefinitely, even after the cursor leaves the OverlayTrigger: Mouse over the trigger, wait for the tool-tip to appear, then rapidly click and drag mouse the cursor off the component. I was able to reproduce this behavior in Chrome, Firefox, and Internet Explorer.This behavior can be demonstrated using the sample code from the documentation:
Place this link anywhere, click and drag off the link quickly, and the tooltip will remain open.
I dove into the OverlayTrigger code a bit, and it seems the mouse click triggers a call to
handleDelayedShow()(since that gives the wrapped component focus), which sets the_hoverDelayproperty. WhenhandleDelayedHide()is invoked right after, it will just callclearTimeout(this._hoverDelay)and return, thus keeping the tooltip visible.I think this behavior can be disabled by only specifying
hoveras a trigger. Perhapsfocusshould not be a default trigger?