Skip to content

{enter} on input type=number leads to invalid input (3.8.0 regression) #5968

@Narretz

Description

@Narretz

Current behavior:

when you type a number in an number input and then type enter, the input becomes empty and the console logs an error:

cypress_runner.js:107262 The specified value "12\n" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?

You can see that the {enter} adds \n to the input value.

Desired behavior:

It should set the value without \n

Steps to reproduce: (app code and test code)

html:

<input type="number" id="input" />

spec code:

cy.get('#input')
  .type('2')
  .type('{enter}')

Versions

Cypress 3.8.0
edit: Chrome 79 with cypress run

Possibly related to #5854

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions