Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix memory leak with regression test #25
Sorry about that...
It looks like jsdom has some environment conflicts with this repository, and I think it is necessary to be included during the test. How can I make it pass? @ljharb
If we mousedown on outside area without mouseup serval times, multiple zombie mouseup eventListener will be added to document. In next click cycle(mousedown then mouseup), these zombies will trigger props.onOutsideClick at the same time which should be an unexpected behavior.
#20 fixed the problem. To make a regression test case, we need to trigger mouseup eventListener in document instead of call instance.onMouseUp(event);(This will call props.onOutsideClick only once but still leaves zombies unexposed).
document.dispatchEvent(mouseUpEvent) requires jsdom and so does onMouseDown function.
Any suggestions...? @ljharb