diff --git a/frontend/resources/styles/main/partials/dashboard-team.scss b/frontend/resources/styles/main/partials/dashboard-team.scss index 55a1bf487..f018f95f5 100644 --- a/frontend/resources/styles/main/partials/dashboard-team.scss +++ b/frontend/resources/styles/main/partials/dashboard-team.scss @@ -4,7 +4,7 @@ padding: 14px; box-shadow: 0px 4px 8px rgba($color-black, 0.25); border-radius: 8px; - width: 450px; + width: 500px; position: fixed; form { @@ -23,9 +23,12 @@ } .custom-select { - width: 155px; + width: 180px; overflow: hidden; justify-content: normal; + select { + height: auto; + } } .action-buttons { diff --git a/frontend/resources/styles/main/partials/forms.scss b/frontend/resources/styles/main/partials/forms.scss index e3728e4ab..ac3c4ea07 100644 --- a/frontend/resources/styles/main/partials/forms.scss +++ b/frontend/resources/styles/main/partials/forms.scss @@ -230,6 +230,8 @@ textarea { .custom-multi-input { border-radius: 2px; border: 1px solid $color-gray-20; + max-height: 300px; + overflow-y: auto; &.invalid { label { @@ -253,7 +255,7 @@ textarea { } .selected-item { - // margin-bottom: 5px; + width: 100%; &:not(:last-child) { margin-right: 3px; diff --git a/frontend/src/app/main/ui/components/forms.cljs b/frontend/src/app/main/ui/components/forms.cljs index 44a97f340..3c61dbce5 100644 --- a/frontend/src/app/main/ui/components/forms.cljs +++ b/frontend/src/app/main/ui/components/forms.cljs @@ -141,9 +141,9 @@ :focus @focus? :valid (and touched? (not error)) :invalid (and touched? error) - :disabled disabled + :disabled disabled) ;; :empty (str/empty? value) - ) + on-focus #(reset! focus? true) on-change (fn [event] @@ -278,7 +278,7 @@ (let [value (str/join " " (map :text items))] (fm/update-input-value! form input-name value)))) - on-key-up + on-key-down (mf/use-fn (mf/deps @value) (fn [event] @@ -309,12 +309,13 @@ remove-item! (mf/use-fn (fn [item] - (swap! items #(into #{} (remove (fn [x] (= x item))) %))))] + (swap! items #(into [] (remove (fn [x] (= x item))) %))))] - (mf/with-effect [result] - (if (every? :valid result) - (update-form! result) - (update-form! []))) + (mf/with-effect [result @value] + (let [val (cond-> @value trim str/trim) + values (conj-dedup result {:text val :valid (valid-item-fn val)}) + values (filterv #(:valid %) values)] + (update-form! values))) [:div {:class klass} (when-let [items (seq @items)] @@ -331,7 +332,7 @@ :auto-focus true :on-focus on-focus :on-blur on-blur - :on-key-up on-key-up + :on-key-down on-key-down :value @value :on-change on-change :placeholder (when empty? label)}] diff --git a/frontend/src/app/main/ui/dashboard/team.cljs b/frontend/src/app/main/ui/dashboard/team.cljs index 7b76b2349..ca0e2502b 100644 --- a/frontend/src/app/main/ui/dashboard/team.cljs +++ b/frontend/src/app/main/ui/dashboard/team.cljs @@ -118,7 +118,7 @@ :on-error (partial on-error form)}] (st/emit! (dd/invite-team-member (with-meta params mdata)) (dd/fetch-team-invitations))))] - + [:div.modal.dashboard-invite-modal.form-container [:& fm/form {:on-submit on-submit :form form} [:div.title