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,18 +248,16 @@ checkboxes :: forall a ...@@ -248,18 +248,16 @@ 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" , on: { click: \_ -> set
, checked: Set.member a val $ const
, on: { click: \_ -> set $ toggleSet a val
$ const }
$ toggleSet a val }
} , H.div {} [H.text $ show a]
} ]
, H.div {} [H.text $ show a] ) xs
]
) xs
prettyNodeType :: GT.NodeType -> String prettyNodeType :: GT.NodeType -> String
......
...@@ -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