Constrain filter edit tabs to scroll within the modal
This commit is contained in:
1 parent
30ca4d6680
commit
eb2e271a08
1 file changed
+55
-39
@@ -75,46 +75,62 @@ export function FilterEditForm({ websiteId, onChange, onClose }: FilterEditFormP
|
|||||||
setCurrentCohort(type === 'cohort' ? id : undefined);
|
setCurrentCohort(type === 'cohort' ? id : undefined);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const panelStyle = { overflowY: 'auto' as const, minHeight: 0 };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column width={isMobile ? 'auto' : '800px'} gap="6">
|
<Column
|
||||||
<Column minHeight="500px">
|
width={isMobile ? 'auto' : '800px'}
|
||||||
<Tabs>
|
gap="6"
|
||||||
<TabList>
|
minHeight="500px"
|
||||||
<Tab id="fields">{t(labels.fields)}</Tab>
|
style={{
|
||||||
{!isPixelLink && (
|
maxHeight: isMobile
|
||||||
<>
|
? 'calc(100dvh - 64px)'
|
||||||
<Tab id="segments">{t(labels.segments)}</Tab>
|
: 'calc(min(80dvh, 100dvh - 40px) - 64px)',
|
||||||
<Tab id="cohorts">{t(labels.cohorts)}</Tab>
|
}}
|
||||||
</>
|
>
|
||||||
)}
|
<Tabs
|
||||||
</TabList>
|
style={{
|
||||||
<TabPanel id="fields">
|
flex: 1,
|
||||||
<FieldFilters
|
minHeight: 0,
|
||||||
websiteId={websiteId}
|
gridTemplateRows: 'auto 1fr',
|
||||||
value={currentFilters}
|
overflow: 'hidden',
|
||||||
match={currentMatch}
|
}}
|
||||||
onChange={setCurrentFilters}
|
>
|
||||||
onMatchChange={setCurrentMatch}
|
<TabList>
|
||||||
exclude={excludedFields}
|
<Tab id="fields">{t(labels.fields)}</Tab>
|
||||||
/>
|
{!isPixelLink && (
|
||||||
</TabPanel>
|
<>
|
||||||
<TabPanel id="segments">
|
<Tab id="segments">{t(labels.segments)}</Tab>
|
||||||
<SegmentFilters
|
<Tab id="cohorts">{t(labels.cohorts)}</Tab>
|
||||||
websiteId={websiteId}
|
</>
|
||||||
segmentId={currentSegment}
|
)}
|
||||||
onChange={handleSegmentChange}
|
</TabList>
|
||||||
/>
|
<TabPanel id="fields" style={panelStyle}>
|
||||||
</TabPanel>
|
<FieldFilters
|
||||||
<TabPanel id="cohorts">
|
websiteId={websiteId}
|
||||||
<SegmentFilters
|
value={currentFilters}
|
||||||
type="cohort"
|
match={currentMatch}
|
||||||
websiteId={websiteId}
|
onChange={setCurrentFilters}
|
||||||
segmentId={currentCohort}
|
onMatchChange={setCurrentMatch}
|
||||||
onChange={handleSegmentChange}
|
exclude={excludedFields}
|
||||||
/>
|
/>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
</Tabs>
|
<TabPanel id="segments" style={panelStyle}>
|
||||||
</Column>
|
<SegmentFilters
|
||||||
|
websiteId={websiteId}
|
||||||
|
segmentId={currentSegment}
|
||||||
|
onChange={handleSegmentChange}
|
||||||
|
/>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel id="cohorts" style={panelStyle}>
|
||||||
|
<SegmentFilters
|
||||||
|
type="cohort"
|
||||||
|
websiteId={websiteId}
|
||||||
|
segmentId={currentCohort}
|
||||||
|
onChange={handleSegmentChange}
|
||||||
|
/>
|
||||||
|
</TabPanel>
|
||||||
|
</Tabs>
|
||||||
<Row
|
<Row
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
|
|||||||
Reference in new issue
Block a user