From 87f17276f5864e5fa9fbee61c8c1b9f0ea18d9b0 Mon Sep 17 00:00:00 2001 From: Camila Belo Date: Tue, 17 May 2022 09:53:32 +0200 Subject: [PATCH] fix(search): use parent if its state is defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Anders Näsman Signed-off-by: Camila Belo --- plugins/search/src/components/SearchModal/useSearchModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/search/src/components/SearchModal/useSearchModal.tsx b/plugins/search/src/components/SearchModal/useSearchModal.tsx index 09afb34008..b813a8db7a 100644 --- a/plugins/search/src/components/SearchModal/useSearchModal.tsx +++ b/plugins/search/src/components/SearchModal/useSearchModal.tsx @@ -136,7 +136,7 @@ export function useSearchModal(initialState = false) { ); // Inherit from parent context, if set. - return parentContextValue + return parentContextValue?.state ? parentContextValue : { state, toggleModal, setOpen }; }