From c9d423d99a0eb4be2b4cc808ae11e42fc2cd04de Mon Sep 17 00:00:00 2001 From: ks129 <45097959+ks129@users.noreply.github.com> Date: Mon, 8 Feb 2021 16:45:33 +0200 Subject: Simplify if check --- src/pages/FormPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/FormPage.tsx b/src/pages/FormPage.tsx index b8518c0..0023db4 100644 --- a/src/pages/FormPage.tsx +++ b/src/pages/FormPage.tsx @@ -221,7 +221,7 @@ function FormPage(): JSX.Element { if (invalidFieldIds.length) { const firstErrored = questions[invalidFieldIds[0]]; - if (firstErrored !== undefined) { + if (firstErrored) { firstErrored.props.scroll_ref.current.scrollIntoView({ behavior: "smooth", block: "center" }); } return; -- cgit v1.2.3