Un format the last auto format. And fix the preventDefault console err

This commit is contained in:
Bill Richardson 2023-07-13 11:14:46 -04:00
parent 8c78204602
commit 526c34cd49

View file

@ -134,27 +134,27 @@ export default {
const { errorMessage, handleBlur, handleChange, meta, validate, errors } =
useField(props.inputId, props.validationRules, fieldOptions);
return {
errorMessage,
handleBlur,
handleChange,
validate,
meta,
errors,
};
},
methods: {
trimOnPaste(evt) {
evt.stopPropagation();
preventDefault();
return {
errorMessage,
handleBlur,
handleChange,
validate,
meta,
errors,
};
},
methods: {
trimOnPaste(evt) {
evt.stopPropagation();
var data = null;
if (evt.type === "paste") {
data = evt.clipboardData || window.clipboardData;
} else if (evt.type === "drop") {
data = evt.dataTransfer;
}
const value = data.getData("Text")?.trim();
var data = null;
if (evt.type === "paste") {
data = evt.clipboardData || window.clipboardData;
} else if (evt.type === "drop") {
data = evt.dataTransfer;
evt.preventDefault();
}
const value = data.getData("Text")?.trim();
this.$emit("update:modelValue", value);
},