Skip to content

Commit 9adb76c

Browse files
committed
Support dynamic type size change for underline
1 parent c742c2c commit 9adb76c

File tree

1 file changed

+9
-0
lines changed
  • WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components

1 file changed

+9
-0
lines changed

WooCommerce/Classes/ViewRelated/ReusableViews/SwiftUI Components/TopTabView.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ struct TopTabView<Content: View>: View {
164164
scrollFocusTab(in: scrollViewProxy, at: index)
165165
}
166166
}
167+
.onChange(of: geometry.size) { newSize in
168+
/// Support dynamic type size change
169+
if index < tabWidths.count {
170+
tabWidths[index] = newSize.width
171+
if index == selectedTab {
172+
underlineTabWith(tabGeometry: geometry)
173+
}
174+
}
175+
}
167176
})
168177
}
169178
}

0 commit comments

Comments
 (0)