Commit 5530fae5 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski Committed by Alexandre Delanoë

[react] use defaultChecked when there is no onChange handler

parent f4e5de5a
...@@ -333,7 +333,10 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt ...@@ -333,7 +333,10 @@ pageCpt = R.hooksComponentWithModule thisModule "page" cpt
, maybeStricken delete [ H.text source ] , maybeStricken delete [ H.text source ]
, maybeStricken delete [ H.text authors ] , maybeStricken delete [ H.text authors ]
-- , maybeStricken $ intercalate [comma] (pairUrl <$> pairs) -- , maybeStricken $ intercalate [comma] (pairUrl <$> pairs)
, H.input { type: "checkbox", checked: isChecked id, on: { click: toggleClick } } , H.input { defaultChecked: isChecked id
, on: { click: toggleClick }
, type: "checkbox"
}
] ]
, delete: true } , delete: true }
where where
......
...@@ -248,10 +248,8 @@ checkboxes :: forall a ...@@ -248,10 +248,8 @@ checkboxes :: forall a
-> R.State (Set a) -> R.State (Set a)
-> R.Element -> R.Element
checkboxes xs (val /\ set) = checkboxes xs (val /\ set) =
H.fieldset {} $ map ( H.fieldset {} $ map (\a -> H.div {} [ H.input { type: "checkbox"
\a -> H.div {} [ , defaultChecked: Set.member a val
H.input { type: "checkbox"
, checked: Set.member a val
, on: { click: \_ -> set , on: { click: \_ -> set
$ const $ const
$ toggleSet a val $ toggleSet a val
......
...@@ -110,7 +110,7 @@ sideTab (Opened SideTabData) props = ...@@ -110,7 +110,7 @@ sideTab (Opened SideTabData) props =
[ RH.span {} [ RH.text text ] [ RH.span {} [ RH.text text ]
, RH.input { type: "checkbox" , RH.input { type: "checkbox"
, className: "checkbox" , className: "checkbox"
, checked: true , defaultChecked: true
, title: "Mark as completed" } ] , title: "Mark as completed" } ]
......
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