From f10557a2114d1c50bba625b014af2b434e4164f0 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 26 Apr 2023 20:04:22 +0800 Subject: [PATCH] fix(Tabs): should scroll active tab into view after resized (#11777) --- packages/vant/src/tabs/Tabs.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/vant/src/tabs/Tabs.tsx b/packages/vant/src/tabs/Tabs.tsx index ba856238b..a232e0f94 100644 --- a/packages/vant/src/tabs/Tabs.tsx +++ b/packages/vant/src/tabs/Tabs.tsx @@ -424,7 +424,11 @@ export default defineComponent({ const resize = () => { setLine(); - nextTick(() => contentRef.value?.swipeRef.value?.resize()); + + nextTick(() => { + scrollIntoView(true); + contentRef.value?.swipeRef.value?.resize(); + }); }; watch(