-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Cypress' type() not compatible with react 15.6's onChange? #536
Comments
Cypress doesn't rely on any specific JS frameworks' implementation. It's firing events at the lowest possible level. We'll take a look at this. In We use React internally on all of our projects. @chrisbreiding can you look at this? |
The input logic in React now dedupe's change events so they don't fire more than once per value. It listens for both browser This works fine in normal cases because a "real" browser initiated event doesn't trigger |
I can confirm this problem is happening. |
We've been able to reproduce and fix it. We're going to release an |
Thank you @brian-mann |
Thank you for your quick work. :) |
Thanks for the timely info, @jquense! That helped a lot. |
Fixed in |
@brian-mann i'm having the same issue in a non-related project. Could you share the way you fixed this? I'm guessing you switched from |
@brian-mann btw if you used my |
We did use the However we thought about it later and have a "real" fix being implemented that's not React specific, and should actually fix the problem permanently... This is from my notes: |
To clarify I don't think the react team needs to make this change. We determined the exact situation where Cypress deviates from the way a real browser behaves. A real browser will NOT call the Since we call the setter (this is the difference). However as long as we call the original setter (that 3rd party code cannot possibly get notified of) we'll essentially reproduce the real browser behavior without needing any 3rd party library to change the way it works. |
sounds great :) |
Are you requesting a feature or reporting a bug?
Bug
Our cypress tests started to fail when we bumped react from 15.5.4 to 15.6.1. We debugged the problem and came to the conclusion that
onChange
doesn't fire as it should when the input field is being manipulated using.type('some text')
.cli + headless chrome: broken
app + real chrome: broken
user interacting with the browser: working
React component:
and this is how we are manipulating it
onChange doesn't fire anymore. The problem went away when we downgraded back to 15.5.4.
Not sure if related, but react-dom's CHANGELOG says:
which is suspicious. Is cypress'
type()
relying on an implementation detail that is not true anymore?The text was updated successfully, but these errors were encountered: