fix: preview table scrolling — proper flex constraints for table body scroll

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 14:12:26 +05:30
parent 64309d506b
commit 0295790c9a
2 changed files with 6 additions and 4 deletions

View File

@@ -21,6 +21,7 @@ interface DynamicTableProps<T extends DynamicRow> {
rowClassName?: (row: T) => string;
size?: 'sm' | 'md';
maxRows?: number;
className?: string;
}
export const DynamicTable = <T extends DynamicRow>({
@@ -30,11 +31,12 @@ export const DynamicTable = <T extends DynamicRow>({
rowClassName,
size = 'sm',
maxRows,
className,
}: DynamicTableProps<T>) => {
const displayRows = maxRows ? rows.slice(0, maxRows) : rows;
return (
<Table size={size} aria-label="Dynamic table">
<Table size={size} aria-label="Dynamic table" className={className}>
<Table.Header>
{columns.map(col => (
<Table.Head key={col.id} id={col.id} label={col.headerRenderer ? '' : col.label}>

View File

@@ -304,7 +304,7 @@ export const LeadImportWizard = ({ isOpen, onOpenChange }: LeadImportWizardProps
{/* Step 3: Preview Table */}
{step === 'preview' && (
<div className="flex flex-1 flex-col min-h-0 overflow-hidden">
<div className="flex flex-1 flex-col min-h-0">
{/* Summary bar */}
<div className="flex shrink-0 items-center gap-4 px-6 py-2 border-b border-secondary text-xs text-tertiary">
<span>{rowsWithMatch.length} rows</span>
@@ -314,8 +314,8 @@ export const LeadImportWizard = ({ isOpen, onOpenChange }: LeadImportWizardProps
{noPhoneCount > 0 && <span className="text-error-primary">{noPhoneCount} no phone</span>}
</div>
{/* Table — fills remaining space, scrolls internally */}
<div className="flex-1 min-h-0 overflow-hidden px-4 pt-2">
{/* Table — fills remaining space, body scrolls */}
<div className="flex-1 min-h-0 overflow-auto px-4 pt-2">
<DynamicTable<DynamicRow>
columns={[
...mapping.filter(m => m.leadField).map(m => ({