Commit 7ea42dc8 authored by Joachim Schunk's avatar Joachim Schunk

add help to input-text with addons and correct gap

parent 1d6bd5a5
......@@ -25,7 +25,7 @@
(defn input-text
[{:keys [field-class input-class input-size label-icon
placeholder value on-change label icons expanded?
disabled tooltip autocomplete readonly?]}]
disabled tooltip autocomplete readonly? help]}]
(let [id (gensym "input-text")]
(reagent/create-class
{:component-did-mount (fn []
......@@ -42,26 +42,29 @@
:reagent-render
(fn [{:keys [field-class input-class input-size label-icon
placeholder value on-change label icons expanded?
disabled tooltip autocomplete readonly?]}]
disabled tooltip autocomplete readonly? help]}]
[:<> ;;:div.field {:class field-class}
#_(when label
[:label.label {:for id} label])
[control {:icons icons
:expanded? expanded?}
[:input.input (merge {:id id
:type "text"
:class input-class
:value value
:placeholder (or placeholder "")
:size input-size
:disabled disabled
:read-only readonly?
:on-change #(on-change (-> %
.-target
.-value))}
(when tooltip
{:data-position (:position tooltip)
:data-tooltip (:label tooltip)}))]
[:<>
[:input.input (merge {:id id
:type "text"
:class input-class
:value value
:placeholder (or placeholder "")
:size input-size
:disabled disabled
:read-only readonly?
:on-change #(on-change (-> %
.-target
.-value))}
(when tooltip
{:data-position (:position tooltip)
:data-tooltip (:label tooltip)}))]
(when help
[:div.help help])]
#_(when label-icon
[icon label-icon
:class "is-left"])]])})))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment