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

InputNumber: cannot insert fractional digits when minFractionDigits=0 #9272

Closed
Timmeeeey opened this issue Sep 11, 2020 · 24 comments
Closed
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@Timmeeeey
Copy link

Timmeeeey commented Sep 11, 2020

I'm submitting a ...

[x] bug report
[ ] feature request
[ ] support request

Plunkr Case (Bug Reports)
https://stackblitz.com/edit/github-cshg3y

Current behavior
If minFractionDigits = 0 and maxFractionDigits > 0 you cannot insert any fractional digits.

Minimal reproduction of the problem with instructions
<p-inputNumber mode="decimal" [minFractionDigits]="0" [maxFractionDigits]="5"></p-inputNumber>

  • Angular version: 10

  • PrimeNG version: 10.0.2

@pete4dev
Copy link

I also encountered this issue.

@anujtrehan
Copy link

got any solution for this?

@FabienDehopre
Copy link

this issue also exists in primeng 9.x

@anujtrehan
Copy link

it the issue fixed in primeng 10.x ??

@FabienDehopre
Copy link

FabienDehopre commented Nov 4, 2020

I cloned their stackblitz from the official documentation page: https://stackblitz.com/edit/primeng-inputnumber-demo-4apujo?file=src/app/app.component.html
There is one example with the minFractionDigits set to 0 and one bigger than 0. So, you can see that the first one does not allow entering decimal digits by hand or by pasting (it works when bound to a value with decimals).
The second one (with minFractionDigits set to 2) allows entering decimal value by hand but has really strange behavior when pasting (if you copy/paste a value in the second input, the value becomes 100 when clicking outside the input or pressing enter).

@evandouglas
Copy link

evandouglas commented Nov 16, 2020

I am experiencing this as well.
<p-inputNumber mode="decimal" [minFractionDigits]="0" [maxFractionDigits]="5">
does not allow me to input any decimal points, but this:
<p-inputNumber mode="decimal" [minFractionDigits]="1" [maxFractionDigits]="5">
does. The downside here is that it always displays '.0' on my numbers if no other decimal is put in.

I am experiencing this on v10.0.3

@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 25, 2020
@yigitfindikli yigitfindikli self-assigned this Nov 25, 2020
@serdarceran
Copy link

Hello @yigitfindikli,

We'd be appreciated if the possible fix is applied to the primeng 9.1.3 as well?

@FabienDehopre
Copy link

Hello @yigitfindikli,

We'd be appreciated if the possible fix is applied to the primeng 9.1.3 as well?

Indeed, it would be really nice

@Sun3
Copy link

Sun3 commented Jan 17, 2021

Any updates? This feature is very important to be able to allow the user to not enter any fractions or enter them if necessary.

Thanks.

@jvdyck
Copy link

jvdyck commented Feb 1, 2021

I have the same problem! Would be nice if this gets fixed.

@jmynes
Copy link

jmynes commented Feb 25, 2021

Same problem, any acknowledgement?
The behavior I'm seeking is to support decimals, but not necessarily append one until the user has actually input a decimal.

This is communicated to the user via a placeholder I've set of 0.00, without actually enforcing a decimal on all inputs

@OPunktSchmidt
Copy link

Any news? From our perspective, the error is very critical. For us, PrimeNG is useless if it doesn't work.

@ThorstenKunz
Copy link

Same issue here

@saul-lopez
Copy link

This issue is also present in 11.3.1.

@danbord
Copy link

danbord commented Apr 21, 2021

Seriously? This is still opened? Bug is still in 11.3.2

@Anubarak
Copy link

Seriously? This is still opened? Bug is still in 11.3.2

Yeah and it is closed and ignored in other prime projects as well

@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Sep 6, 2021
@mertsincan mertsincan added this to the 12.1.1 milestone Sep 6, 2021
@mertsincan
Copy link
Member

Sorry for the delayed response! Fixed now ;)

Best Regards,

@nascarjake
Copy link

This does not appear to be fixed in primeng 11.4.5
Could we get the same fix applied for angular so that the number inputs work like normal allowing me to type a decimal in myself?

@gschafra
Copy link

gschafra commented Dec 7, 2021

Issue still exists in 11.4.9 LTS

@brano-p
Copy link

brano-p commented May 31, 2022

No solution for this after 2 years? Why is this closed anyway? It's a regular bug.

@theophile-wallez
Copy link

The bug is still there

@Raphzor
Copy link

Raphzor commented Jan 5, 2023

Issue still exists on 14.0.1 ...

@MC-Mihai
Copy link

Issue still exists on 15.0.0

@glenndejaeger
Copy link

We have an issue with PrimeVue and I think it's the same as described or strongly related.

  • InputNumber with minFractionDigits set (for example to 2)
  • Default value after the decimal point is 00
    - When clicking after the decimal point and typing 0, nothing happens while I would expect the cursor to shift 1 position to the right
  • When clicking after the decimal point and typing any number other than 0, the 0 is replaced by the entered number and the cursor does shift 1 position to the right. That is expected behaviour.

When entering 0 before the decimal point, the 0 is just inserted at that position, which is expected behaviour as well.

See https://stackblitz.com/edit/gagodi-sjvwmv?file=src%2FApp.vue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests