Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 21 additions & 19 deletions src/components/NcPopover/NcPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export default {
data() {
return {
internalShown: this.shown,
animationDuration: 100,
}
},

Expand All @@ -254,7 +253,6 @@ export default {

mounted() {
this.checkTriggerA11y()
this.animationDuration = parseInt(getComputedStyle(this.$el).getPropertyValue('--animation-quick')) || 100
},

beforeDestroy() {
Expand Down Expand Up @@ -380,33 +378,37 @@ export default {
},

async afterShow() {
this.getPopoverContentElement().addEventListener('transitionend', () => {
/**
* Triggered after the tooltip was visually displayed.
*
* This is different from the 'show' and 'apply-show' which
* run earlier than this where there is no guarantee that the
* tooltip is already visible and in the DOM.
*/
this.$emit('after-show')
}, { once: true, passive: true })

this.removeFloatingVueAriaDescribedBy()

await this.$nextTick()
await this.useFocusTrap()
this.addEscapeStopPropagation()

setTimeout(() => {
/**
* Triggered after the tooltip was visually displayed.
*
* This is different from the 'show' and 'apply-show' which
* run earlier than this where there is no guarantee that the
* tooltip is already visible and in the DOM.
*/
this.$emit('after-show')
}, this.animationDuration)
},
async afterHide() {
this.clearFocusTrap()
this.clearEscapeStopPropagation()

setTimeout(() => {
afterHide() {
this.getPopoverContentElement().addEventListener('transitionend', () => {
/**
* Triggered after the tooltip was visually hidden.
*
* This is different from the 'hide' and 'apply-hide' which
* run earlier than this where there is no guarantee that the
* tooltip is already visible and in the DOM.
*/
this.$emit('after-hide')
}, this.animationDuration)
}, { once: true, passive: true })

this.clearFocusTrap()
this.clearEscapeStopPropagation()
},
},
}
Expand Down
Loading