Adds support for input type="checkbox", as requested in #94 . Makes checkboxes send oninput event when clicked. If event isn't bound (there's no data-dioxus-id), they will behave as an unmanaged input, and handle checked state internally. If it is, they will send an oninput event with a FormData argument.
Adds a 'form' example to demonstrate.
Caveats:
They should be drawing their colors using the css property 'accent-color', but I couldnt figure out how to look that up, so they're using just 'color' for now.
There's something up with the vertical alignment when rendering labels with the text 'inline'. Check the second checkbox in the example, or try removing the 'inline-block' from label styling in the css. In chrome and ff, the labels render the same vertically whether inline or inline-block.
The FormEvent has valid: false, as its calculated as 'true' if value is empty? However I've set value to the value of the toggled element. Not sure if this is correct
Checking a checkbox send 'onclick' and 'oninput' events. Not sure if it should send 'onchanged' too? Didnt see any mention of that event in dioxus docs.
Adds support for input type="checkbox", as requested in #94 . Makes checkboxes send
oninput
event when clicked. If event isn't bound (there's no data-dioxus-id), they will behave as an unmanaged input, and handle checked state internally. If it is, they will send an oninput event with a FormData argument.Adds a 'form' example to demonstrate.
Caveats:
valid: false
, as its calculated as 'true' if value is empty? However I've set value to the value of the toggled element. Not sure if this is correct