Skip to content

Commit

Permalink
refactor: keep _model.value as null when assigning empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwu9145 committed Dec 12, 2024
1 parent 3c18a5e commit 6a55990
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/vuetify/src/labs/VNumberInput/VNumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ export const VNumberInput = genericComponent<VNumberInputSlots>()({

const model = computed({
get: () => _model.value,
set (val) {
if (val === null || (typeof val === 'string' && !val)) {
_model.value = val
// 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
}

Expand Down

0 comments on commit 6a55990

Please sign in to comment.