Probably final version of FloatInputTextField

This commit is contained in:
2025-03-24 12:31:07 +01:00
parent 7ac279da8e
commit 0c48df239e
2 changed files with 5 additions and 5 deletions

View File

@@ -30,9 +30,9 @@ const {
value: inputValue,
errorMessage,
handleBlur,
handleChange,
meta
} = useField(name, undefined, {
initialValue: props.value,
initialValue: props.value
});
const invalid = computed(() => errorMessage.value ? true : undefined);
@@ -42,13 +42,13 @@ const invalid = computed(() => errorMessage.value ? true : undefined);
<div class="grid grid-cols-1 gap-2">
<FloatLabel variant="on">
<InputText
:id="id" v-model="inputValue" class="w-full" :invalid="invalid" @blur="handleBlur" @input="handleChange"
:id="id" v-model="inputValue" class="w-full" :invalid="invalid" @blur="handleBlur"
/>
<label :for="id">
{{ label }}
</label>
</FloatLabel>
<Message v-if="errorMessage" class="text-wrap">{{ errorMessage }}</Message>
<Message v-if="errorMessage && meta.touched" class="text-wrap">{{ errorMessage }}</Message>
</div>
</template>