From 9ff701bb7183cde9ed30ba9fbff05930a10331d6 Mon Sep 17 00:00:00 2001 From: Rohan singh Date: Fri, 4 Apr 2025 11:52:42 +0530 Subject: [PATCH] Resolved issue: Overlay Issue in Name and Organization Fields on Person View Page #1916 --- .../controls/inline/lookup.blade.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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..5eafe1a89 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 @@ -235,6 +235,8 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round dropdownPosition: "bottom", isRTL: document.documentElement.dir === 'rtl', + + uniqueId: Math.floor(100000 + Math.random() * 900000), }; }, @@ -255,6 +257,16 @@ 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('lookup-dropdown-opened', (data) => { + if (data.componentId !== this.uniqueId) { + this.showPopup = false; + } + }); + }, + + beforeUnmount() { + this.$emitter.off('lookup-dropdown-opened'); }, computed: { @@ -295,6 +307,8 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round }, toggleEditor() { + this.$emitter.emit('lookup-dropdown-opened', { componentId: this.uniqueId }); + this.showPopup = ! this.showPopup; if (this.showPopup) { @@ -331,7 +345,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 +451,4 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round }, }); -@endPushOnce \ No newline at end of file +@endPushOnce