mirror of
https://github.com/penpot/penpot.git
synced 2025-05-19 23:36:11 +02:00
🐛 Fix intro action in multi input
This commit is contained in:
parent
140731cf34
commit
8795e134c1
4 changed files with 11 additions and 5 deletions
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
|
- Fix intro action in multi input [Taiga #3541](https://tree.taiga.io/project/penpot/issue/3541)
|
||||||
- Fix team default image [Taiga #3919](https://tree.taiga.io/project/penpot/issue/3919)
|
- Fix team default image [Taiga #3919](https://tree.taiga.io/project/penpot/issue/3919)
|
||||||
- Fix problem with group coordinates [#2008](https://github.com/penpot/penpot/issues/2008)
|
- Fix problem with group coordinates [#2008](https://github.com/penpot/penpot/issues/2008)
|
||||||
- Fix problem with line-height and texts [Taiga #3578](https://tree.taiga.io/project/penpot/issue/3578)
|
- Fix problem with line-height and texts [Taiga #3578](https://tree.taiga.io/project/penpot/issue/3578)
|
||||||
|
|
|
@ -243,7 +243,7 @@
|
||||||
(into [] (distinct) (conj coll item)))
|
(into [] (distinct) (conj coll item)))
|
||||||
|
|
||||||
(mf/defc multi-input
|
(mf/defc multi-input
|
||||||
[{:keys [form label class name trim valid-item-fn] :as props}]
|
[{:keys [form label class name trim valid-item-fn on-submit] :as props}]
|
||||||
(let [form (or form (mf/use-ctx form-ctx))
|
(let [form (or form (mf/use-ctx form-ctx))
|
||||||
input-name (get props :name)
|
input-name (get props :name)
|
||||||
touched? (get-in @form [:touched input-name])
|
touched? (get-in @form [:touched input-name])
|
||||||
|
@ -297,8 +297,11 @@
|
||||||
(dom/prevent-default event)
|
(dom/prevent-default event)
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
(let [val (cond-> @value trim str/trim)]
|
(let [val (cond-> @value trim str/trim)]
|
||||||
|
(when (and (kbd/enter? event) (str/empty? @value) (not-empty @items))
|
||||||
|
(on-submit form))
|
||||||
|
(when (not (str/empty? @value))
|
||||||
(reset! value "")
|
(reset! value "")
|
||||||
(swap! items conj-dedup {:text val :valid (valid-item-fn val)})))
|
(swap! items conj-dedup {:text val :valid (valid-item-fn val)}))))
|
||||||
|
|
||||||
(and (kbd/backspace? event)
|
(and (kbd/backspace? event)
|
||||||
(str/empty? @value))
|
(str/empty? @value))
|
||||||
|
|
|
@ -142,7 +142,8 @@
|
||||||
:auto-focus? true
|
:auto-focus? true
|
||||||
:trim true
|
:trim true
|
||||||
:valid-item-fn us/parse-email
|
:valid-item-fn us/parse-email
|
||||||
:label (tr "modals.invite-member.emails")}]
|
:label (tr "modals.invite-member.emails")
|
||||||
|
:on-submit on-submit}]
|
||||||
[:& fm/select {:name :role :options roles}]]
|
[:& fm/select {:name :role :options roles}]]
|
||||||
|
|
||||||
[:div.action-buttons
|
[:div.action-buttons
|
||||||
|
|
|
@ -171,7 +171,8 @@
|
||||||
:auto-focus? true
|
:auto-focus? true
|
||||||
:trim true
|
:trim true
|
||||||
:valid-item-fn us/parse-email
|
:valid-item-fn us/parse-email
|
||||||
:label (tr "modals.invite-member.emails")}]
|
:label (tr "modals.invite-member.emails")
|
||||||
|
:on-submit on-submit}]
|
||||||
[:& fm/select {:name :role :options roles}]]
|
[:& fm/select {:name :role :options roles}]]
|
||||||
|
|
||||||
[:div.buttons
|
[:div.buttons
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue