From 4e618d871ce13d99eeb91f9a79184c96abbcf1a9 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 31 Oct 2023 16:02:33 -0400 Subject: [PATCH] [FOIA22-156] Don't allow submit if trimmed query is empty --- js/components/wizard_page_query.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/components/wizard_page_query.jsx b/js/components/wizard_page_query.jsx index 954fceea..3837bc5b 100644 --- a/js/components/wizard_page_query.jsx +++ b/js/components/wizard_page_query.jsx @@ -54,7 +54,7 @@ function Query() { onClick={() => { setSubmitted(true); actions.submitRequest({ - query: query || '', + query: (query || '').trim(), topic: selectedTopic, }); }} @@ -114,7 +114,7 @@ function Query() { disabled={Boolean(selectedTopic)} /> - {(query && query !== '' && !exceededMaxLengthQuery) ? submitButton : null} + {(query && query.trim() !== '' && !exceededMaxLengthQuery) ? submitButton : null}