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

Input number bug impossible to resolve! #29532

Closed
MakesCode opened this issue May 17, 2024 · 1 comment
Closed

Input number bug impossible to resolve! #29532

MakesCode opened this issue May 17, 2024 · 1 comment

Comments

@MakesCode
Copy link

MakesCode commented May 17, 2024

Current behavior

It is impossible to set a value on an input of type number without the value changing!

Desired behavior

cy.get('[data-testid="coupon-value"] input').should('have.value', value.toString());

Test code to reproduce

<input type="number" data-testid="coupon-value" />
const value = "44"

exemple 1 :

cy.get('[data-testid="coupon-value"] input').clear() // value = 1

exemple 2 :

cy.get('[data-testid="coupon-value"] input').clear().type(value); // value = 441 (44 + clear =1)

exemple 3 :

cy.get('[data-testid="coupon-value"] input')
  .clear() // value = 1
  .invoke('val', value) 
  .trigger('input') 
  .trigger('change') 
// value = 44

cy.wait(4000); // value = 1

Cypress Version

"^12.4.1"

Node version

v22.1.0

Operating System

macOs : 14.2.1

Debug Logs

No response

Other

No response

@MakesCode
Copy link
Author

resolved :
cy.get('[data-testid="coupon-value"] input').clear().type('44{rightArrow}{backspace}')

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

No branches or pull requests

1 participant