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

[Bug Report][3.6.5] (VNumberInput): interpretes negative numbers as NaN #19798

Open
guenbakku opened this issue May 13, 2024 · 4 comments · May be fixed by #19913
Open

[Bug Report][3.6.5] (VNumberInput): interpretes negative numbers as NaN #19798

guenbakku opened this issue May 13, 2024 · 4 comments · May be fixed by #19913
Assignees
Labels
C: VNumberInput T: bug Functionality that does not work as intended/expected

Comments

@guenbakku
Copy link

guenbakku commented May 13, 2024

Environment

Vuetify Version: 3.6.5
Vue Version: 3.4.27
Browsers: Chrome 124.0.0.0
OS: Windows 10

Steps to reproduce

  1. Enter a minus sign (≒hyphen -)
    (Copy&Pasting a minus also causes same behavior)

image

Expected Behavior

The input field should accept negative numbers if the min prop is set to a value less than zero

Actual Behavior

As soon as you enter a minus, the input will be replaced with a literal string of NaN.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

This may relate to the following issue:
#2359

@johnleider johnleider added T: bug Functionality that does not work as intended/expected C: VNumberInput and removed S: triage labels May 13, 2024
@kchobantonov
Copy link

The same happens when chars like 'e' or '+' are entered for number is exponent format like 4e+100

@yuwu9145 yuwu9145 linked a pull request Jun 4, 2024 that will close this issue
@yuwu9145
Copy link
Member

yuwu9145 commented Jun 4, 2024

@kchobantonov I don't see much value to support exponent format in number-input, can't you use text-field instead?

@kchobantonov
Copy link

@yuwu9145 yes I can use that but then I need to use that for all numbers since I do not know upfront in what kind of format those number are going to come when loading the forms (e.g. when the data is already specified)

@jakubmatisak
Copy link

jakubmatisak commented Jun 11, 2024

It also happens when I'm writing decimals like 3.5, but when I do a missclick and put there two dots, like 3..5, then it's automatically changed to NaN - I would expect it will automatically ignore second dot, cause this will be common mistake.

Also when starting with dot (e.g: .5). it'ts changed to NaN, guess it should be changed to 0.5 or ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VNumberInput T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants