Skip to content

Commit

Permalink
fix+perf(QCarousel/QStepper/QTabPanels): active panel renders twice i…
Browse files Browse the repository at this point in the history
…nitially #17698
  • Loading branch information
rstoenescu committed Dec 14, 2024
1 parent 5199c49 commit 0c06962
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion ui/src/composables/private.use-panel/use-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,18 @@ export default function () {

let panels, forcedPanelTransition

const panelIndex = ref(null)
const panelTransition = ref(null)

/*
* Should not be reactive because it's assigned on render
* and it will trigger a subsequent useless render.
*
* Should be an object though, because it is being exported.
* Otherwise, the current value would be exported and no subsequent
* updates will be reflected in the exported value.
*/
const panelIndex = { value: null }

function onSwipe (evt) {
const dir = props.vertical === true ? 'up' : 'left'
goToPanelByOffset((proxy.$q.lang.rtl === true ? -1 : 1) * (evt.direction === dir ? 1 : -1))
Expand Down

0 comments on commit 0c06962

Please sign in to comment.