diff options
| author | Terry Truong <terry06890@gmail.com> | 2023-01-02 16:37:52 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2023-01-02 16:37:52 +1100 |
| commit | d67b35629905b6c26648c7979c28c333664f102f (patch) | |
| tree | f9e07ba3115620003cfff0343827bb3e6d853464 | |
| parent | 092d310c5c56dfd9af9de553ddbc6f86b4c957bd (diff) | |
Skip Timeline transitions for all resize events
Previously, skipping was only done upon vertical/horzontal
orientation change. This didn't address cases like maximising the
window without changing orientation, where pre-existing timeline
ticks would animate out-of-sync with new ones.
| -rw-r--r-- | src/components/TimeLine.vue | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue index b50141a..087d504 100644 --- a/src/components/TimeLine.vue +++ b/src/components/TimeLine.vue @@ -102,7 +102,6 @@ const width = ref(0); const height = ref(0); const availLen = computed(() => props.vert ? height.value : width.value); const availBreadth = computed(() => props.vert ? width.value : height.value); -const prevVert = ref(props.vert); // Previous 'vert' value, used for skipping transitions on horz/vert swap const mounted = ref(false); onMounted(() => { let rootEl = rootRef.value!; @@ -118,11 +117,8 @@ const resizeObserver = new ResizeObserver((entries) => { width.value = WRITING_MODE_HORZ ? boxSize.inlineSize : boxSize.blockSize; height.value = WRITING_MODE_HORZ ? boxSize.blockSize : boxSize.inlineSize; // Check for horz/vert swap - if (props.vert != prevVert.value){ - skipTransition.value = true; - setTimeout(() => {skipTransition.value = false}, 100); // Note: Using nextTick() doesn't work - prevVert.value = props.vert; - } + skipTransition.value = true; + setTimeout(() => {skipTransition.value = false}, 100); // Note: Using nextTick() doesn't work } } }); |
