Skip to content

Commit 8adc7bf

Browse files
authoredNov 14, 2024··
fix: prevent view-transition in the same slide (#1942)
1 parent 688e9cf commit 8adc7bf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎packages/client/composables/useViewTransition.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function useViewTransition() {
1717
const toMeta = getSlide(to.params.no as string)?.meta
1818
const fromNo = fromMeta?.slide?.no
1919
const toNo = toMeta?.slide?.no
20-
const transitionType = fromNo != null && toNo != null
20+
const transitionType = fromNo != null && toNo != null && fromNo !== toNo
2121
&& ((fromNo < toNo ? fromMeta?.transition : toMeta?.transition) ?? configs.transition)
2222
if (transitionType !== 'view-transition') {
2323
isViewTransition.value = false
@@ -41,7 +41,6 @@ export function useViewTransition() {
4141

4242
// Wait for `TransitionGroup` to become normal `div`
4343
setTimeout(() => {
44-
// @ts-expect-error missing types
4544
document.startViewTransition(() => {
4645
changeRoute()
4746
return promise

0 commit comments

Comments
 (0)
Please sign in to comment.