0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 23:18:48 -05:00

🐛 Don't raise an unexpected exception on multiple-input enter

When a enter is pressed and field is empty
This commit is contained in:
Andrey Antukh 2024-10-10 10:31:07 +02:00 committed by Alonso Torres
parent c4941bb102
commit bd6f1bef10

View file

@ -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)))