diff --git a/src/components/AdvancedSearchBox.tsx b/src/components/AdvancedSearchBox.tsx index 0c18b22..0a239e4 100644 --- a/src/components/AdvancedSearchBox.tsx +++ b/src/components/AdvancedSearchBox.tsx @@ -61,6 +61,21 @@ const AdvancedSearchBox = ({ return fullQuery; } + function validSearch() { + let valid = query ? query.length > 2 : false; + if (valid) { + return true; + } + inputs.forEach((input) => { + if (input.value ? input.value.length > 2 : false) { + valid = true; + return; + } + }); + console.log('disabled', valid); + return valid; + } + useEffect(() => { ElasticSearchStatsService(indexName) .then((res) => { @@ -105,7 +120,11 @@ const AdvancedSearchBox = ({ }} view={({ onSubmit }) => (
-