You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the user.click or user.pointer API to simulate a 'click' gesture on an element that has its own 'pointerdown' and 'click' event handlers setup.
Call 'event.preventDefault()' in the pointerdown event handling.
Notice that the element's 'click' event handler will not be triggered.
Doing the same without the 'event.preventDefault()' call will result in the 'click' event handler being triggered. In a real browser environment though, calling 'event.preventDefault()' should not prevent an eventual 'click' event from being triggered on an element.
Expected behavior
'click' event handling should be triggered due to the user.click() API call regardless of preventDefault call during previous 'pointerdown' event handling.
Actual behavior
'click' event handling is only triggered when previous 'pointerdown' event handling does not call event.preventDefault()
User-event version
14.0.0
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation: Using real browser testing in Chrome on Mac. It does not seem like 'pointerdown' events are simulated properly using Jest.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Reproduction example
N/A
Prerequisites
Use the user.click or user.pointer API to simulate a 'click' gesture on an element that has its own 'pointerdown' and 'click' event handlers setup.
Call 'event.preventDefault()' in the pointerdown event handling.
Notice that the element's 'click' event handler will not be triggered.
Doing the same without the 'event.preventDefault()' call will result in the 'click' event handler being triggered. In a real browser environment though, calling 'event.preventDefault()' should not prevent an eventual 'click' event from being triggered on an element.
Expected behavior
'click' event handling should be triggered due to the user.click() API call regardless of preventDefault call during previous 'pointerdown' event handling.
Actual behavior
'click' event handling is only triggered when previous 'pointerdown' event handling does not call event.preventDefault()
User-event version
14.0.0
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation: Using real browser testing in Chrome on Mac. It does not seem like 'pointerdown' events are simulated properly using Jest.
Additional context
No response
The text was updated successfully, but these errors were encountered: