fix billable rate input field, fixes ST-203

This commit is contained in:
Gregor Vostrak
2024-06-02 19:02:22 +02:00
parent 22420439d9
commit ee6999af90
3 changed files with 28 additions and 21 deletions

View File

@@ -1,10 +1,9 @@
<script setup lang="ts">
import { onMounted, ref } from 'vue';
defineProps({
modelValue: String,
name: String,
});
defineProps<{
name?: string;
}>();
const input = ref<HTMLInputElement | null>(null);
@@ -15,21 +14,13 @@ onMounted(() => {
});
defineExpose({ focus: () => input.value?.focus() });
const emit = defineEmits(['update:modelValue']);
function updateValue(event: Event) {
if (event.target && 'value' in event.target) {
emit('update:modelValue', event?.target?.value);
}
}
const model = defineModel();
</script>
<template>
<input
ref="input"
class="border-input-border border bg-input-background text-white focus:ring-input-border-active focus:ring-0 focus-visible:border-input-border-active rounded-md shadow-sm"
:value="modelValue"
:name="name"
@input="updateValue" />
v-model="model"
:name="name" />
</template>