0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-06 14:50:20 -05:00
This commit is contained in:
Florian Schroedl 2024-06-25 16:43:52 +02:00
parent b4d1ef3fc7
commit e1b683f670

View file

@ -199,6 +199,10 @@
(mf/deps validate-name validate-descripion token tokens)
(fn [e]
(dom/prevent-default e)
;; We have to re-validate the current form values before submitting
;; because the validation is asynchronous/debounced
;; and the user might have edited a valid form to make it invalid,
;; and press enter before the next validations could return.
(let [final-name (finalize-name @name-ref)
valid-name?+ (-> (validate-name final-name) schema-validation->promise)
final-value (finalize-value @value-ref)