ui(settings): restore scroll synchronously to prevent flicker; dx(ui): name TabContent for clearer DevTools

This commit is contained in:
Daniel Riccio 2025-09-03 18:17:02 -05:00
parent ad07bf4e0d
commit 36489418a7
No known key found for this signature in database
GPG key ID: B3CDA0E073DD9856
2 changed files with 5 additions and 6 deletions

View file

@ -45,6 +45,7 @@ export const TabContent = forwardRef<HTMLDivElement, TabProps>(({ className, chi
</div>
)
})
TabContent.displayName = "TabContent"
export const TabList = forwardRef<
HTMLDivElement,

View file

@ -411,12 +411,10 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
[activeTab],
)
useEffect(() => {
requestAnimationFrame(() => {
if (contentRef.current) {
contentRef.current.scrollTop = scrollPositions.current[activeTab] ?? 0
}
})
useLayoutEffect(() => {
if (contentRef.current) {
contentRef.current.scrollTop = scrollPositions.current[activeTab] ?? 0
}
}, [activeTab])
// Store direct DOM element refs for each tab