numeric fields show the numeric keyboard (#122)
This commit is contained in:
parent
cd14084d7a
commit
60e1f6d6c3
|
@ -15,6 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
<input :id="id?id:name" v-model="compVal" :disabled="disabled"
|
<input :id="id?id:name" v-model="compVal" :disabled="disabled"
|
||||||
:type="nativeType"
|
:type="nativeType"
|
||||||
|
:pattern="pattern"
|
||||||
:style="inputStyle"
|
:style="inputStyle"
|
||||||
:class="[theme.default.input,{ '!ring-red-500 !ring-2': hasValidation && form.errors.has(name), '!cursor-not-allowed !bg-gray-200':disabled }]"
|
:class="[theme.default.input,{ '!ring-red-500 !ring-2': hasValidation && form.errors.has(name), '!cursor-not-allowed !bg-gray-200':disabled }]"
|
||||||
:name="name" :accept="accept"
|
:name="name" :accept="accept"
|
||||||
|
@ -48,6 +49,7 @@ export default {
|
||||||
max: { type: Number, required: false, default: null },
|
max: { type: Number, required: false, default: null },
|
||||||
maxCharLimit: { type: Number, required: false, default: null },
|
maxCharLimit: { type: Number, required: false, default: null },
|
||||||
showCharLimit: { type: Boolean, required: false, default: false },
|
showCharLimit: { type: Boolean, required: false, default: false },
|
||||||
|
pattern: { type: String, default: null }
|
||||||
},
|
},
|
||||||
|
|
||||||
data: () => ({}),
|
data: () => ({}),
|
||||||
|
|
|
@ -498,6 +498,8 @@ export default {
|
||||||
inputProperties.accept = (this.form.is_pro && field.allowed_file_types) ? field.allowed_file_types : ""
|
inputProperties.accept = (this.form.is_pro && field.allowed_file_types) ? field.allowed_file_types : ""
|
||||||
} else if (field.type === 'number' && field.is_rating) {
|
} else if (field.type === 'number' && field.is_rating) {
|
||||||
inputProperties.numberOfStars = parseInt(field.rating_max_value)
|
inputProperties.numberOfStars = parseInt(field.rating_max_value)
|
||||||
|
} else if (['number', 'phone_number'].includes(field.type)) {
|
||||||
|
inputProperties.pattern = "/\d*"
|
||||||
}
|
}
|
||||||
|
|
||||||
return inputProperties
|
return inputProperties
|
||||||
|
|
Loading…
Reference in New Issue