From 3cc7765b35012dd9c5f44a6cf9b310887acb8cf7 Mon Sep 17 00:00:00 2001 From: RitvikSardana Date: Wed, 18 Dec 2024 14:12:15 +0530 Subject: [PATCH] fix: add blur handler for text fields --- desk/src/components/UniInput2.vue | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/desk/src/components/UniInput2.vue b/desk/src/components/UniInput2.vue index 605b2b6eb..65763dcc9 100644 --- a/desk/src/components/UniInput2.vue +++ b/desk/src/components/UniInput2.vue @@ -11,12 +11,26 @@ > + emitUpdate( + field.fieldname, + event.value || event.target.value + ), + } + : { + change: (event) => + emitUpdate( + field.fieldname, + event.value || event.target.value + ), + } " /> @@ -47,6 +61,8 @@ interface E { const props = defineProps

(); const emit = defineEmits(); +const textFields = ["Long Text", "Small Text", "Text"]; + const component = computed(() => { if (props.field.url_method) { return h(Autocomplete, { @@ -75,9 +91,7 @@ const component = computed(() => { }, ], }); - } else if ( - ["Long Text", "Small Text", "Text"].includes(props.field.fieldtype) - ) { + } else if (textFields.includes(props.field.fieldtype)) { return h(FormControl, { type: "textarea", });