(e: MouseEvent)
| 785 | }; |
| 786 | |
| 787 | let onMouseUp = (e: MouseEvent) => { |
| 788 | // Only handle left clicks |
| 789 | if (e.button !== 0) { |
| 790 | return; |
| 791 | } |
| 792 | |
| 793 | if (state.ignoreEmulatedMouseEvents) { |
| 794 | state.ignoreEmulatedMouseEvents = false; |
| 795 | return; |
| 796 | } |
| 797 | |
| 798 | if ( |
| 799 | state.target && |
| 800 | nodeContains(state.target, getEventTarget(e) as Element) && |
| 801 | state.pointerType != null |
| 802 | ) { |
| 803 | // Wait for onClick to fire onPress. This avoids browser issues when the DOM |
| 804 | // is mutated between onMouseUp and onClick, and is more compatible with third party libraries. |
| 805 | } else { |
| 806 | cancelEvent(e); |
| 807 | } |
| 808 | |
| 809 | state.isOverTarget = false; |
| 810 | }; |
| 811 | |
| 812 | pressProps.onTouchStart = e => { |
| 813 | if (!nodeContains(e.currentTarget, getEventTarget(e))) { |
nothing calls this directly
no test coverage detected