diff --git a/x-pack/plugins/lens/public/app_plugin/settings_menu.tsx b/x-pack/plugins/lens/public/app_plugin/settings_menu.tsx index e4cd670286ef6..f4447929d8063 100644 --- a/x-pack/plugins/lens/public/app_plugin/settings_menu.tsx +++ b/x-pack/plugins/lens/public/app_plugin/settings_menu.tsx @@ -45,13 +45,14 @@ export function SettingsMenu({ const dispatch = useLensDispatch(); const toggleAutoApply = useCallback(() => { + onClose(); writeToStorage( new Storage(localStorage), AUTO_APPLY_DISABLED_STORAGE_KEY, String(autoApplyEnabled) ); dispatch(autoApplyEnabled ? disableAutoApply() : enableAutoApply()); - }, [dispatch, autoApplyEnabled]); + }, [dispatch, autoApplyEnabled, onClose]); return (