question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.type() negative number into input not working

See original GitHub issue

Current behavior:

When typing negative number into input with type “number” set, minus is ignored and possitive number is typed instead.

used method: cy.type()

numbertypebug

Desired behavior:

Type negative number.

Steps to reproduce:

html

Versions

Cypress: 3.0.2 Windows 10 Chrome 67

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kucebcommented, Jul 19, 2019

@TheBestPessimist Thanks for this. I see the issue, we don’t take into account that the input has a selection. You can workaround this by doing .clear() before .type() for now. I’ll open an issue to fix this

Edit: see open issue here #4767

1reaction
TheBestPessimistcommented, Jul 18, 2019

in v 3.4.0 i can confirm this bug still appears.

See: 0000000333

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - Is there any way to prevent input type="number" getting ...
I wanted to allow decimal numbers and not clear the entire input if a negative was inputted. This works well in chrome at...
Read more >
Trouble setting negative value for input field - Archive
I'm trying to set a negative value on an input field that always defaults to 0. When using setText to enter 7500, it...
Read more >
Prevent negative value from being entered in HTML input type ...
While creating HTML5 input type number in the html form, I would like to disable or prevent user from entering negative number in...
Read more >
How does JS interpret negative numbers obtained from a ...
I used an expression where the answer was a negative integer and ran into something unexpected. It seems like the code was interpreting...
Read more >
Convert Negative Number into Positive | Excel Basic Tutorial
Below you have a range of cells with negative numbers. So to convert them into positive you just need to enter the formula...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found