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
, maybeStricken delete [ H.text source ]
, maybeStricken delete [ H.text authors ]
-- , 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 }
where
......
......@@ -248,18 +248,16 @@ checkboxes :: forall a
-> R.State (Set a)
-> R.Element
checkboxes xs (val /\ set) =
H.fieldset {} $ map (
\a -> H.div {} [
H.input { type: "checkbox"
, checked: Set.member a val
, on: { click: \_ -> set
$ const
$ toggleSet a val
}
}
, H.div {} [H.text $ show a]
]
) xs
H.fieldset {} $ map (\a -> H.div {} [ H.input { type: "checkbox"
, defaultChecked: Set.member a val
, on: { click: \_ -> set
$ const
$ toggleSet a val
}
}
, H.div {} [H.text $ show a]
]
) xs
prettyNodeType :: GT.NodeType -> String
......
......@@ -110,7 +110,7 @@ sideTab (Opened SideTabData) props =
[ RH.span {} [ RH.text text ]
, RH.input { type: "checkbox"
, className: "checkbox"
, checked: true
, defaultChecked: true
, 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