Skip to content

Commit c3f39b0

Browse files
committed
fix: v-model string
1 parent 448b6c0 commit c3f39b0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/components/CvNumberInput/CvNumberInput.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
</template>
9999

100100
<script setup>
101-
import { computed, ref, useSlots, nextTick } from 'vue';
101+
import { computed, ref, useSlots } from 'vue';
102102
import Add16 from '@carbon/icons-vue/es/add/16';
103103
import Subtract16 from '@carbon/icons-vue/es/subtract/16';
104104
import WarningFilled16 from '@carbon/icons-vue/es/warning--filled/16';
@@ -202,9 +202,8 @@ const internalValue = computed({
202202
},
203203
set(value) {
204204
displayValue.value = formatInputValueType(value);
205-
if (Number.isNaN(displayValue.value) || displayValue.value === 'NaN') {
206-
displayValue.value = 0;
207-
nextTick(() => (displayValue.value = NaN));
205+
if (typeof value === 'string') {
206+
input.value.value = '';
208207
}
209208
onInput(displayValue.value);
210209
},

0 commit comments

Comments
 (0)