mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-10 15:14:33 +08:00
Merge pull request #8793 from aignatov-bio/ai-sci-12250-fix-nested-general-dropdown
Fix nested general dropdown [SCI-12250]
This commit is contained in:
commit
cedfc21846
1 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,7 @@
|
|||
<template v-if="isOpen">
|
||||
<teleport to="body">
|
||||
<div @click="closeOnClick && closeMenu()" ref="flyout"
|
||||
:id="randomId"
|
||||
class="sn-dropdown fixed z-[3000] bg-sn-white inline-block
|
||||
rounded p-2.5 sn-shadow-menu-sm"
|
||||
:class="{
|
||||
|
@ -42,7 +43,8 @@ export default {
|
|||
},
|
||||
data() {
|
||||
return {
|
||||
isOpen: false
|
||||
isOpen: false,
|
||||
randomId: `dropdown-${Math.random().toString(36).substring(2, 15)}`,
|
||||
};
|
||||
},
|
||||
directives: {
|
||||
|
@ -70,7 +72,7 @@ export default {
|
|||
}
|
||||
},
|
||||
closeMenu(e) {
|
||||
if (e && e.target.closest('.sn-dropdown, .sn-select-dropdown, .sn-menu-dropdown, .dp__instance_calendar')) return;
|
||||
if (e && e.target.closest(`.sn-dropdown#${this.randomId}, .sn-select-dropdown, .sn-menu-dropdown, .dp__instance_calendar`)) return;
|
||||
this.isOpen = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue