From bd6f1bef10c0e6923d496d2332f282e23ca2167e Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Thu, 10 Oct 2024 10:31:07 +0200 Subject: [PATCH] :bug: Don't raise an unexpected exception on multiple-input enter When a enter is pressed and field is empty --- frontend/src/app/main/ui/components/forms.cljs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/main/ui/components/forms.cljs b/frontend/src/app/main/ui/components/forms.cljs index 15361c42f..2e673e4c0 100644 --- a/frontend/src/app/main/ui/components/forms.cljs +++ b/frontend/src/app/main/ui/components/forms.cljs @@ -483,7 +483,8 @@ ;; Empty values means "submit" the form (whent some items have been added (when (and (kbd/enter? event) (str/empty? @value) (not-empty @items)) - (on-submit form)) + (when (fn? on-submit) + (on-submit form event))) ;; If we have a string in the input we add it only if valid (when (and (valid-item-fn val) (not (str/empty? @value)))