Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

InputNumber: "-" sign on empty input is ignored

Aperta
#8,548 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
react
Ambito
frontend

Direzione di ricerca

Inizia con il riproduttore CodeSandbox collegato e con l’implementazione di PrimeReact InputNumber, concentrandoti sul percorso dell’input vuoto quando viene premuto il tasto meno. Conferma che il campo mantenga «-» e che il cursore rimanga alla fine senza inserire 0.00, quindi verifica il comportamento previsto nei browser e nelle versioni elencati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

When the InputNumber field is empty, focusing it and pressing the minus (-) key to enter a negative number causes 0.00 to be inserted automatically, and the caret jumps to the end of the input. As a result, it's impossible to enter a negative value directly. The user must first select and delete the entire 0.00 value and only then can enter a negative number.

I know that It worked correctly in PrimeReact v10.8.4.

Reproducer

https://codesandbox.io/p/sandbox/6h56ml

System Information
System:
    OS: macOS 26.5
    CPU: (10) arm64 Apple M4
    Memory: 71.41 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.19.4 - /Users/{{username}}/.nvm/versions/node/v20.19.4/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.8.2 - /Users/{{username}}/.nvm/versions/node/v20.19.4/bin/npm
  Browsers:
    Brave Browser: 147.1.89.132
    Chrome: 148.0.7778.216
    Firefox: 149.0.2
    Safari: 26.5
  npmPackages:
    primereact: 10.9.8 => 10.9.8
    react: 18.3.1 => 18.3.1
Steps to reproduce the behavior
  1. Open reproducer. There will be an empty number input.
  2. Focus it and type "-"

Actual result: "0.00" appears in the input, caret stays in position after the decimal point

Expected behavior

"-" should be displayed in the input, caret stays at the end of the input

Lingua principale
CSS
Stelle
8.3k
Fork
1.2k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di primefaces/primereact

Tutte le issue di primefaces/primereact

Issue simili

Altre issue su Web Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.