Skip to content

Commit

Permalink
fix: 리뷰 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
jhn3981 committed Feb 13, 2024
1 parent 3b6e7dd commit 49d85ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vibrant-components/src/lib/TabGroup/TabGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const TabGroup = withTabGroupVariation(
const tabInViewRefs = useRef<boolean[]>(new Array(Children.count(children)).fill(false));

const { breakpointIndex } = useResponsiveValue();
const isLaptop = breakpointIndex > 1;
const isLaptop = breakpointIndex > 1 && !isNative;

const setTabRef = (id: string) => (node: HTMLElement | null) => {
if (!node) {
Expand All @@ -74,7 +74,7 @@ export const TabGroup = withTabGroupVariation(
};

useEffect(() => {
if (!tabRefs.current[tabId] || !tabGroupRef.current || isNative) {
if (!tabRefs.current[tabId] || !tabGroupRef.current || !isLaptop) {
return;
}

Expand All @@ -89,7 +89,7 @@ export const TabGroup = withTabGroupVariation(
tabRefs.current[tabId].offsetWidth / 2,
behavior: 'smooth',
});
}, [tabId]);
}, [isLaptop, tabId]);

useIsomorphicLayoutEffect(() => {
tabInViewRefs.current = new Array(Children.count(children)).fill(false);
Expand Down

0 comments on commit 49d85ba

Please sign in to comment.