JedWatson / react-tappable

Tappable component for React
http://jedwatson.github.io/react-tappable/
MIT License
863 stars 90 forks source link

Programmatically "Tap" element from the console #116

Open edwilliams opened 6 years ago

edwilliams commented 6 years ago

Is it possible to simulate a "Tap" from the console?

If an element is given a synthetic onClick event in React, the element itself can be identified in the DOM from the console in DevTools and a 'click' event simulated. For example (using jQuery for ease of demonstration)

$('[data-qa="some-element"]').click()

Is an equivalent event possible form the console?

aalibasic commented 6 years ago

Try doing a mouse down then a mouse up event on the element.