react-tappable icon indicating copy to clipboard operation
react-tappable copied to clipboard

onMouseOut doesn't fire

Open slorber opened this issue 9 years ago • 3 comments
trafficstars

source:

    onMouseOut: function (event) {
        if (window._blockMouseEvents || !this._mouseDown) return;
        this.processEvent(event);
        this.props.onMouseOut && this.props.onMouseOut(event);
        this.endMouseEvent();
    },

If I have <Tappable otherThings... onMouseOut={callback}/>, the callback will never be fired on mouse out, because !this._mouseDown is false. I think this is unexpected no?

slorber avatar Jun 10 '16 17:06 slorber

I'm also interested in the reason for this. Would be happy to work on a PR to fix if I understand the cases.

aarosil avatar Jun 15 '16 23:06 aarosil

Can confirm this is an issue. I was able to work around it by adding the onMouseOut event to a child component of Tappable but that isn't a nice solution, and straight up won't work for a lot of use cases.

onMouseOut should fire whether the mouse is currently down or not. Is there a technical reason for the !this._mouseDown check?

Today's state of devices means that touch/mouse support is needed in unison, making this a pretty important issue imo.

MilllerTime avatar Aug 12 '16 21:08 MilllerTime

PRs welcome, but please add an example with instructions for testing

dcousens avatar May 08 '17 01:05 dcousens