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

Displaying zero in numberinput #3614

Closed
gardnerluke opened this issue Dec 10, 2021 · 2 comments · Fixed by #3654
Closed

Displaying zero in numberinput #3614

gardnerluke opened this issue Dec 10, 2021 · 2 comments · Fixed by #3654

Comments

@gardnerluke
Copy link

Buefy version: [0.9.13]
Vuejs version: [2]
OS/Browser: Chrome

Description

I'm not sure if this is intended and therefore a feature request or a bug. The numberinput component does not display a zero when using the controls. Is this intended? I can't seem to make it display the zero with any Buefy properties to set.

@DariaGarmash
Copy link

Hi all

I consider that as a bug and was about to open an issue here.

B-numberinput component should

  • emit value 0 if input value is 0 (on focus or on control)
  • emit null if value is erased

With some debugging I have ended up component never emits 0, but null, because it is missing check (|| value == 0)

image

@ErikKrause
Copy link

ErikKrause commented Jan 3, 2022

If the line with Number(value) is meant to set all invalid input to null, shouldn't that line be
let newValue = (Number(value) === 0)?0:(Number(value) || null)?

dagnelies added a commit to dagnelies/buefy that referenced this issue Feb 4, 2022
Applying suggested fix for buefy#3614
jtommy pushed a commit that referenced this issue Feb 4, 2022
Applying suggested fix for #3614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants