Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document simulating browser events #352

Closed
gaearon opened this issue Nov 27, 2017 · 3 comments
Closed

Document simulating browser events #352

gaearon opened this issue Nov 27, 2017 · 3 comments

Comments

@gaearon
Copy link
Member

gaearon commented Nov 27, 2017

Maybe for the FAQ. It's commonly asked how to simulate events in React. We have Simulate helpers but they only trigger the React events without the browser behavior. In some cases that's not enough. We also have SimulateNative helpers but they're undocumented and I think we should get rid of them (facebook/react#11656).

What we should do IMO is to document how to use browser APIs to dispatch normal browser events. Surprisingly many people have no idea (including myself a few weeks ago). For example: facebook/react#11111 (comment). (It's also commonly missed that the node needs to be in the document for this to work with React.)

@radubrehar
Copy link

radubrehar commented Nov 29, 2017

I'm working on this. Need 2-3 days and will send it over for review.

@radubrehar
Copy link

Build preview deployed at https://deploy-preview-375--reactjs.netlify.com

jhonmike pushed a commit to jhonmike/reactjs.org that referenced this issue Jul 1, 2020
@eps1lon
Copy link
Collaborator

eps1lon commented Aug 23, 2020

This should be sufficiently covered by now in Testing Recipes#events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants