Browse Source

fix: adjust padding for tab indicator calculation

imwald
codytseng 9 months ago
parent
commit
0be08c2312
  1. 2
      src/components/Tabs/index.tsx

2
src/components/Tabs/index.tsx

@ -30,7 +30,7 @@ export default function Tabs({
if (activeIndex >= 0 && tabRefs.current[activeIndex]) { if (activeIndex >= 0 && tabRefs.current[activeIndex]) {
const activeTab = tabRefs.current[activeIndex] const activeTab = tabRefs.current[activeIndex]
const { offsetWidth, offsetLeft } = activeTab const { offsetWidth, offsetLeft } = activeTab
const padding = 32 // 16px padding on each side const padding = 24 // 12px padding on each side
setIndicatorStyle({ setIndicatorStyle({
width: offsetWidth - padding, width: offsetWidth - padding,
left: offsetLeft + padding / 2 left: offsetLeft + padding / 2

Loading…
Cancel
Save