@@ -235,8 +235,6 @@ 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 ),
240
238
};
241
239
},
242
240
@@ -258,15 +256,7 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round
258
256
mounted () {
259
257
window .addEventListener (" resize" , this .setDropdownPosition );
260
258
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' );
259
+ this .$emitter .on (' show-pop' , this .handleShowPop );
270
260
},
271
261
272
262
computed: {
@@ -307,12 +297,16 @@ class="item-center flex justify-center bg-red-100 p-1 hover:bg-red-200 ltr:round
307
297
},
308
298
309
299
toggleEditor () {
310
- this .$emitter .emit (' lookup-dropdown-opened' , { componentId: this .uniqueId });
300
+ this .$emitter .emit (' show-pop' , this .$ .uid );
301
+ },
311
302
312
- this .showPopup = ! this .showPopup ;
303
+ handleShowPop (uid ) {
304
+ this .showPopup = (uid === this .$ .uid );
313
305
314
306
if (this .showPopup ) {
315
- this .$nextTick (() => this .$refs .searchInput .focus ());
307
+ this .$nextTick (() => this .$refs .searchInput ? .focus ());
308
+ } else {
309
+ this .isEditing = false ;
316
310
}
317
311
},
318
312
0 commit comments