From 894779ba7c50202163daf9c6fb7b1e5a1e42927a Mon Sep 17 00:00:00 2001 From: minekuba Date: Sat, 4 Jan 2025 01:52:53 +0100 Subject: [PATCH] fix: InputNumber cannot enter negative values 0 when using allow-empty=false --- packages/primevue/src/inputnumber/InputNumber.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/inputnumber/InputNumber.vue b/packages/primevue/src/inputnumber/InputNumber.vue index aad82e928..af0026a6c 100755 --- a/packages/primevue/src/inputnumber/InputNumber.vue +++ b/packages/primevue/src/inputnumber/InputNumber.vue @@ -634,7 +634,9 @@ export default { let newValueStr; if (sign.isMinusSign) { - if (selectionStart === 0) { + const value = this.parseValue(inputValue); + + if (selectionStart === 0 || value === 0) { newValueStr = inputValue; if (minusCharIndex === -1 || selectionEnd !== 0) {