Skip to content

Cypress' type() not compatible with react 15.6's onChange? #536

@arthens

Description

@arthens
  • Operating System: Mac os X and Linux
  • Cypress Version: 0.19.2 (app) and 0.13.1 (cli)
  • Browser/Browser Version: Chrome 58

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:

<input
    className="input-text"
    onChange={() => {
        // this will executed with react 15.5.4, but not with 15.6.1
    }}
    value={this.props.value}
    type="text"
    data-stock-url />

and this is how we are manipulating it

cy.visit('https://...')
    .get('[data-stock-url]').type('https://google.com/stock/123')

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:

  • Fix issues with onChange not firing properly for some inputs. (@jquense in #8575)

which is suspicious. Is cypress' type() relying on an implementation detail that is not true anymore?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions