Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ const DetailsPanelPopover = ({
}: DetailsPanelProps) => {
const theme = useTheme();

function defaultActivePanel() {
if (incompatibleIndicators.length) return 'incompatible';
if (appliedIndicators.length) return 'applied';
return 'unset';
function defaultActivePanels() {
if (incompatibleIndicators.length) return ['incompatible'];
if (appliedIndicators.length) return ['applied'];
return ['unset'];
}

const [activePanel, setActivePanel] = useState(defaultActivePanel);
const [activePanels, setActivePanels] = useState<string | string[]>(defaultActivePanels);

function handlePopoverStatus(isOpen: boolean) {
// every time the popover opens, choose the active panel anew
if (isOpen) {
setActivePanel(defaultActivePanel());
setActivePanels(defaultActivePanels());
}
}

Expand All @@ -97,7 +97,7 @@ const DetailsPanelPopover = ({
<Panel>
<div>{`${total} Scoped Filters`}</div>
<Reset>
<Collapse ghost activeKey={[activePanel]}>
<Collapse ghost activeKey={activePanels} onChange={setActivePanels}>
{appliedIndicators.length ? (
<Collapse.Panel
key="applied"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class FilterBox extends React.Component {
return this.onFilterMenuOpen(TIME_RANGE);
}

onCloseDateFilterControl() {
onCloseDateFilterControl = () => {
return this.onFilterMenuClose(TIME_RANGE);
}

Expand Down