Got tab content scrolling working

This commit is contained in:
Gregory Schier
2023-03-11 22:36:13 -08:00
parent df22285d15
commit f846fa8dbc
9 changed files with 60 additions and 59 deletions

View File

@@ -23,9 +23,16 @@ export function Tabs({ defaultValue, label, children, tabs, className, tabListCl
<T.Root
defaultValue={defaultValue}
onValueChange={setValue}
className={classnames(className, 'h-full overflow-hidden')}
className={classnames(
className,
// 'h-full overflow-hidden grid grid-rows-[auto_minmax(0,1fr)]',
'h-full flex flex-col min-h-[min-content]',
)}
>
<T.List aria-label={label} className={classnames(tabListClassName, 'flex items-center')}>
<T.List
aria-label={label}
className={classnames(tabListClassName, 'h-auto flex items-center')}
>
<ScrollArea className="w-full pb-2">
<HStack space={1}>
{tabs.map((t) => (
@@ -75,7 +82,7 @@ export function TabContent({ value, children, className }: TabContentProps) {
<T.Content
forceMount
value={value}
className={classnames(className, 'tab-content', 'w-full h-full')}
className={classnames(className, 'tab-content', 'w-full overflow-auto flex-grow h-0')}
>
{children}
</T.Content>