From 0dea26f67d87ca877d00fa0f876d9e6bba2da9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Thu, 29 Feb 2024 22:48:07 +0100 Subject: [PATCH] Do not allow search if query is empty --- assets/controllers/elements/part_livesearch_controller.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/controllers/elements/part_livesearch_controller.js b/assets/controllers/elements/part_livesearch_controller.js index e1350172..1bd00e9f 100644 --- a/assets/controllers/elements/part_livesearch_controller.js +++ b/assets/controllers/elements/part_livesearch_controller.js @@ -107,6 +107,11 @@ export default class extends Controller { return; } + //Do not submit the form, if the input is empty + if (state.query === "") { + return; + } + input.value = state.query; input.form.requestSubmit(); },