File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
assets/js/components/Config Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 8383 <div class =" position-relative flex-grow-1" >
8484 <input
8585 :id =" id"
86- v-model =" value"
86+ :value =" value"
8787 :list =" datalistId"
8888 :type =" inputType"
8989 :step =" step"
9898 "
9999 :autocomplete =" masked || datalistId ? 'off' : null"
100100 :disabled =" disabled"
101+ @change =" onFieldChange"
102+ @input =" onFieldInput"
101103 />
102104 <button
103105 v-if =" showClearButton"
@@ -346,6 +348,20 @@ export default {
346348 },
347349 },
348350 methods: {
351+ coerceValue (val ) {
352+ if (this .inputType === " number" ) {
353+ return val === " " ? " " : Number (val);
354+ }
355+ return val;
356+ },
357+ onFieldChange (e ) {
358+ this .value = this .coerceValue (e .target .value );
359+ },
360+ onFieldInput (e ) {
361+ if (! this .useLazyBinding ) {
362+ this .value = this .coerceValue (e .target .value );
363+ }
364+ },
349365 getOptionName (value ) {
350366 const translationKey = ` config.options.${ this .property } .${ value || " none" } ` ;
351367 return this .$te (translationKey) ? this .$t (translationKey) : value;
You can’t perform that action at this time.
0 commit comments