[UI] Dropdown's hidden class should be set as a property.

This commit is contained in:
Fabio Manganiello 2024-10-14 21:46:13 +02:00
parent 9b99c1e19d
commit 117dfad64e
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774
2 changed files with 2 additions and 3 deletions

View file

@ -5,7 +5,7 @@
<span class="text" v-text="text" v-if="text" />
</button>
<div class="body-container hidden" ref="dropdownContainer">
<div class="body-container" :class="{ hidden: !visible }" ref="dropdownContainer">
<DropdownBody :id="id"
:keepOpenOnItemClick="keepOpenOnItemClick"
:style="style"
@ -143,7 +143,6 @@ export default {
this.$el.appendChild(element)
this.visible = true
this.$refs.dropdownContainer.classList.remove('hidden')
this.$nextTick(this.adjustDropdownPos)
},
@ -179,7 +178,6 @@ export default {
element.style.top = `${pos.top}px`
element.style.left = `${pos.left}px`
bus.emit('dropdown-open', this.$refs.dropdown)
this.$refs.dropdownContainer.classList.add('hidden')
},
toggle(event) {

View file

@ -14,6 +14,7 @@ export default {
if (!component.keepOpenOnItemClick)
this.onClose()
component.$el.classList.remove('hidden')
this.$el.appendChild(component.$el)
},