@@ -235,6 +235,8 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round
235
235
dropdownPosition: " bottom" ,
236
236
237
237
isRTL: document .documentElement .dir === ' rtl' ,
238
+
239
+ uniqueId: Math .floor (100000 + Math .random () * 900000 ),
238
240
};
239
241
},
240
242
@@ -255,6 +257,16 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round
255
257
256
258
mounted () {
257
259
window .addEventListener (" resize" , this .setDropdownPosition );
260
+
261
+ this .$emitter .on (' lookup-dropdown-opened' , (data ) => {
262
+ if (data .componentId !== this .uniqueId ) {
263
+ this .showPopup = false ;
264
+ }
265
+ });
266
+ },
267
+
268
+ beforeUnmount () {
269
+ this .$emitter .off (' lookup-dropdown-opened' );
258
270
},
259
271
260
272
computed: {
@@ -295,6 +307,8 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round
295
307
},
296
308
297
309
toggleEditor () {
310
+ this .$emitter .emit (' lookup-dropdown-opened' , { componentId: this .uniqueId });
311
+
298
312
this .showPopup = ! this .showPopup ;
299
313
300
314
if (this .showPopup ) {
@@ -331,7 +345,7 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round
331
345
})
332
346
.catch ((error ) => {
333
347
this .isDirty = false ;
334
-
348
+
335
349
this .inputValue = this .value ;
336
350
337
351
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
437
451
},
438
452
});
439
453
</script >
440
- @endPushOnce
454
+ @endPushOnce
0 commit comments