Closed alexander-rymasheusky closed 3 years ago
How can I set maxlength attribute on a label? Tried these ways and none worked:
maxlength
(ns app.my-views (:require [reforms.reagent :include-macros true :as f])) (defn component [] (let [data (atom {}) on-submit #(debug "on-submit")] (fn [] [:div (f/form {:on-submit on-submit} [:input {:type "text" :max-length 4}] ;; <-- This works as expected, ie maxlength is set in the DOM (f/text "Comment:" data [:comment] :maxlength 1 :max-length 2 :attrs {:maxlength 3 :max-length 4}) )])))
FWIW, I'm using Reagent.
How can I set
maxlength
attribute on a label? Tried these ways and none worked:FWIW, I'm using Reagent.