Skip to content

Commit

Permalink
fix(QTabPanels): tab-panels 'transition' emit fires before transition…
Browse files Browse the repository at this point in the history
… ends (fix #17479). (#17489)
  • Loading branch information
rstoenescu committed Sep 9, 2024
1 parent c4a89e3 commit e622d16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/src/composables/private.use-panel/use-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { h, ref, computed, watch, nextTick, getCurrentInstance, Transition, Keep
import TouchSwipe from '../../directives/touch-swipe/TouchSwipe.js'

import useRenderCache from '../../composables/use-render-cache/use-render-cache.js'
import useTimeout from '../../composables/use-timeout/use-timeout.js'

import { hSlot } from '../../utils/private.render/render.js'
import { getNormalizedVNodes } from '../../utils/private.vm/vm.js'
Expand Down Expand Up @@ -49,6 +50,7 @@ export const usePanelEmits = [ 'update:modelValue', 'beforeTransition', 'transit
export default function () {
const { props, emit, proxy } = getCurrentInstance()
const { getCache } = useRenderCache()
const { registerTimeout } = useTimeout()

let panels, forcedPanelTransition

Expand Down Expand Up @@ -117,11 +119,9 @@ export default function () {
if (panelIndex.value !== index) {
panelIndex.value = index
emit('beforeTransition', newVal, oldVal)
setTimeout(() => {
nextTick(() => {
emit('transition', newVal, oldVal)
})
}, props.transitionDuration);
registerTimeout(() => {
emit('transition', newVal, oldVal)
}, props.transitionDuration)
}
})

Expand Down

0 comments on commit e622d16

Please sign in to comment.