diff --git a/packages/Webkul/Admin/src/Resources/views/components/form/control-group/controls/inline/lookup.blade.php b/packages/Webkul/Admin/src/Resources/views/components/form/control-group/controls/inline/lookup.blade.php index b7b33c0d2..06e5018da 100644 --- a/packages/Webkul/Admin/src/Resources/views/components/form/control-group/controls/inline/lookup.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/components/form/control-group/controls/inline/lookup.blade.php @@ -255,6 +255,8 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round mounted() { window.addEventListener("resize", this.setDropdownPosition); + + this.$emitter.on('show-pop', this.handleShowPop); }, computed: { @@ -295,10 +297,16 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round }, toggleEditor() { - this.showPopup = ! this.showPopup; + this.$emitter.emit('show-pop', this.$.uid); + }, + + handleShowPop(uid) { + this.showPopup = (uid === this.$.uid); if (this.showPopup) { - this.$nextTick(() => this.$refs.searchInput.focus()); + this.$nextTick(() => this.$refs.searchInput?.focus()); + } else { + this.isEditing = false; } }, @@ -331,7 +339,7 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round }) .catch((error) => { this.isDirty = false; - + this.inputValue = this.value; this.$emitter.emit('add-flash', { type: 'error', message: error.response.data.message }); @@ -437,4 +445,4 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round }, }); </script> -@endPushOnce \ No newline at end of file +@endPushOnce