add: input mode

Add input mode for decimals on number fields
This commit is contained in:
Fiona Lena Urban 2025-05-10 13:48:39 +02:00
parent 9a953980dc
commit 0133475e2a
2 changed files with 7 additions and 8 deletions

View file

@ -11,7 +11,7 @@
:required="required"
placeholder=" "
@blur="emit('blur')"
:inputmode="type === 'number' ? 'decimal' : undefined"
:inputmode="mode"
/>
<label :for="id">{{ label }}</label>
</div>
@ -29,6 +29,7 @@ type Props = {
message ?: string
label : string
id : string
mode ?: 'text' | 'email' | 'search' | 'tel' | 'url' | 'none' | 'numeric' | 'decimal'
}
const {
@ -36,6 +37,7 @@ const {
required = false,
step = 0.01,
min = 1,
mode = 'text',
} = defineProps<Props>()
const emit = defineEmits(['blur'])