Skip to content

Commit 752fb02

Browse files
committed
skip animation when tabs wrap to different rows/columns
1 parent c82b2e4 commit 752fb02

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/dialtone-vue/common/utils/indicatorAnimation.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ export function animateIndicator (state, {
5555
}) {
5656
const newRect = newEl.getBoundingClientRect();
5757
const isVertical = orientation === 'vertical';
58+
59+
// Skip animation if elements are on different rows/columns (e.g. wrapped tabs)
60+
const crossAxisDelta = isVertical
61+
? Math.abs(oldRect.left - newRect.left)
62+
: Math.abs(oldRect.top - newRect.top);
63+
if (crossAxisDelta > 1) return;
64+
5865
// Use center-to-center delta so scale from center aligns both edges correctly
5966
const delta = isVertical
6067
? (oldRect.top + oldRect.height / 2) - (newRect.top + newRect.height / 2)

0 commit comments

Comments
 (0)