Skip to content

Conversation

bunyevacz
Copy link

@bunyevacz bunyevacz commented Dec 29, 2018

react warns and removes the checked attribute from
input type=checkbox when markdown contains task lists.
So this plugin replace checked to defaultChecked=true
Note, defaultChecked do not work with react, =true is also
needed (react 16.6.3)

Example, before:

< input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" checked> first line

after:

< input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;" defaultChecked=true> first line

React warning:
Warning: Failed prop type: You provided a checked prop to a form field without an onChange handler. This will render a read-only field. If the field should be mutable use defaultChecked. Otherwise, set either onChange or readOnly.

react warns and *removes* the checked attribute from
input type=checkbox when markdown contains task lists.
So this plugin replace `checked` to `defaultChecked=true`
Note, defaultChecked do not work with react, =true is also
needed (react 16.6.3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant