diff --git a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rules_with_gaps_overview_panel/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rules_with_gaps_overview_panel/index.tsx index 83ab4fc73cc61..8f14ec3d71a78 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rules_with_gaps_overview_panel/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_gaps/components/rules_with_gaps_overview_panel/index.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { EuiButton, @@ -42,6 +42,16 @@ export const RulesWithGapsOverviewPanel = () => { const [isPopoverOpen, setPopover] = useState(false); const telemetry = useKibana().services.telemetry; + useEffect(() => { + return () => { + // reset filter options when unmounting + setFilterOptions({ + gapSearchRange: defaultRangeValue, + showRulesWithGaps: false, + }); + }; + }, [setFilterOptions]); + const rangeValueToLabel = { [GapRangeValue.LAST_24_H]: i18n.RULE_GAPS_OVERVIEW_PANEL_LAST_24_HOURS_LABEL, [GapRangeValue.LAST_3_D]: i18n.RULE_GAPS_OVERVIEW_PANEL_LAST_3_DAYS_LABEL,