antizer icon indicating copy to clipboard operation
antizer copied to clipboard

How to uncheck a Radio Button?

Open ertugrulcetin opened this issue 5 years ago • 1 comments

I could not find a way to uncheck radio buttons? Could you provide some examples?

[ant/radio
          {:value "today" :checked @checked?} ;; does not re-render if it's false
          "Today"]

ertugrulcetin avatar Mar 03 '19 20:03 ertugrulcetin

Hello. You can't uncheck radio button if it alone in radio group. Maybe you should use checkbox or radio-group?


(defn example[_]
  (let [checked? (r/atom true)]
    (fn [_]
      [ant/radio-group
       [ant/radio {:value "today"
                   :checked @checked?} "Today"]
       [ant/radio {:value "tomorrow" } "Tomorrow"]])))

Examples: https://ant.design/components/radio/

Docs: https://developer.mozilla.org/ru/docs/Web/HTML/Element/Input/radio

mishazawa avatar Mar 13 '19 16:03 mishazawa