mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-04-11 10:23:27 +00:00
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:
@@ -21,6 +21,7 @@ interface DynamicTableProps<T extends DynamicRow> {
|
|||||||
rowClassName?: (row: T) => string;
|
rowClassName?: (row: T) => string;
|
||||||
size?: 'sm' | 'md';
|
size?: 'sm' | 'md';
|
||||||
maxRows?: number;
|
maxRows?: number;
|
||||||
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DynamicTable = <T extends DynamicRow>({
|
export const DynamicTable = <T extends DynamicRow>({
|
||||||
@@ -30,11 +31,12 @@ export const DynamicTable = <T extends DynamicRow>({
|
|||||||
rowClassName,
|
rowClassName,
|
||||||
size = 'sm',
|
size = 'sm',
|
||||||
maxRows,
|
maxRows,
|
||||||
|
className,
|
||||||
}: DynamicTableProps<T>) => {
|
}: DynamicTableProps<T>) => {
|
||||||
const displayRows = maxRows ? rows.slice(0, maxRows) : rows;
|
const displayRows = maxRows ? rows.slice(0, maxRows) : rows;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Table size={size} aria-label="Dynamic table">
|
<Table size={size} aria-label="Dynamic table" className={className}>
|
||||||
<Table.Header>
|
<Table.Header>
|
||||||
{columns.map(col => (
|
{columns.map(col => (
|
||||||
<Table.Head key={col.id} id={col.id} label={col.headerRenderer ? '' : col.label}>
|
<Table.Head key={col.id} id={col.id} label={col.headerRenderer ? '' : col.label}>
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ export const LeadImportWizard = ({ isOpen, onOpenChange }: LeadImportWizardProps
|
|||||||
|
|
||||||
{/* Step 3: Preview Table */}
|
{/* Step 3: Preview Table */}
|
||||||
{step === 'preview' && (
|
{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 */}
|
{/* Summary bar */}
|
||||||
<div className="flex shrink-0 items-center gap-4 px-6 py-2 border-b border-secondary text-xs text-tertiary">
|
<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>
|
<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>}
|
{noPhoneCount > 0 && <span className="text-error-primary">{noPhoneCount} no phone</span>}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Table — fills remaining space, scrolls internally */}
|
{/* Table — fills remaining space, body scrolls */}
|
||||||
<div className="flex-1 min-h-0 overflow-hidden px-4 pt-2">
|
<div className="flex-1 min-h-0 overflow-auto px-4 pt-2">
|
||||||
<DynamicTable<DynamicRow>
|
<DynamicTable<DynamicRow>
|
||||||
columns={[
|
columns={[
|
||||||
...mapping.filter(m => m.leadField).map(m => ({
|
...mapping.filter(m => m.leadField).map(m => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user