From 30c1d56be6d77efa58513a9c21acfe086cd11ed4 Mon Sep 17 00:00:00 2001 From: sawka Date: Fri, 6 Sep 2024 16:13:16 -0700 Subject: [PATCH] fix condition --- frontend/app/modals/typeaheadmodal.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/app/modals/typeaheadmodal.tsx b/frontend/app/modals/typeaheadmodal.tsx index 9bac414f7..6784a115f 100644 --- a/frontend/app/modals/typeaheadmodal.tsx +++ b/frontend/app/modals/typeaheadmodal.tsx @@ -94,7 +94,9 @@ const TypeAheadModal = ({ const suggestionsRef = useRef(null); useLayoutEffect(() => { - if (modalRef.current || inputRef.current || suggestionsRef.current || suggestionsWrapperRef.current) return; + if (!modalRef.current || !inputRef.current || !suggestionsRef.current || !suggestionsWrapperRef.current) { + return; + } const modalStyles = window.getComputedStyle(modalRef.current); const paddingTop = parseFloat(modalStyles.paddingTop) || 0;