fix condition

This commit is contained in:
sawka 2024-09-06 16:13:16 -07:00
parent 7b866ed3a8
commit 30c1d56be6

View File

@ -94,7 +94,9 @@ const TypeAheadModal = ({
const suggestionsRef = useRef<HTMLDivElement>(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;