diff --git a/packages/vuetify/src/labs/VNumberInput/VNumberInput.tsx b/packages/vuetify/src/labs/VNumberInput/VNumberInput.tsx index 5e0a2835bbe..f3ee59cbe3b 100644 --- a/packages/vuetify/src/labs/VNumberInput/VNumberInput.tsx +++ b/packages/vuetify/src/labs/VNumberInput/VNumberInput.tsx @@ -74,14 +74,17 @@ export const VNumberInput = genericComponent()({ const model = computed({ get: () => _model.value, - set (val) { - if (val === null) { + // model.value could be empty string from VTextField + // but _model.value should be eventually kept in type Number | null + set (val: Number | null | string) { + if (val === null || val === '') { _model.value = null return } - if (!isNaN(+val) && +val <= props.max && +val >= props.min) { - _model.value = +val + const value = Number(val) + if (!isNaN(value) && value <= props.max && value >= props.min) { + _model.value = value } }, }) @@ -294,9 +297,9 @@ export const VNumberInput = genericComponent()({ { incrementControlNode() } - ) : (!props.reverse - ? <>{ dividerNode() }{ controlNode() } - : undefined) + ) : (props.reverse + ? undefined + : <>{ dividerNode() }{ controlNode() }) const hasAppendInner = slots['append-inner'] || appendInnerControl