Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
981 views
in Technique[技术] by (71.8m points)

angular - PrimeNG p-inputnumber unable to enter negative fractional numbers

I need to capture negative decimals with PrimeNG's p-inputnumber component, but when entering the component, and minFractionDigits is > 0, entering a - jumps the cursor to the end of the display, so the number cannot be captured conventionally.
. I can navigate back with the arrow keys, but it makes the usage painstaking and slow.

<p-inputNumber [(ngModel)]="modelNum" mode="decimal" locale="en-US"
[minFractionDigits]="2" [maxFractionDigits]="2"
(onFocus)="$event.target.select()" (ngModelChange)="calculateResults(row)">
</p-inputNumber>

Has anyone found a solution to this problem?
**Environment:**
Angular version: 10.x
PrimeNG version: 10.0.3
question from:https://stackoverflow.com/questions/65895980/primeng-p-inputnumber-unable-to-enter-negative-fractional-numbers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...