From cc0050ddebec3bf1cf2fc647d657e272f8f23482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E5=8B=87?= Date: Thu, 27 Oct 2016 17:26:31 +0800 Subject: [PATCH] Update forms.md (#8121) --- docs/forms.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/forms.md b/docs/forms.md index b9d8c0c6..df1c0997 100644 --- a/docs/forms.md +++ b/docs/forms.md @@ -98,7 +98,7 @@ Controlled components also let us reset inputs to arbitrary values by setting th ### Potential Issues With Checkboxes and Radio Buttons -Be aware that, in an attempt to normalize change handling for checkbox and radio inputs, React listens to a `click` browser event to implement the `onChange` event. +Be aware that, in an attempt to normalize change handling for checkboxes and radio inputs, React listens to a `click` browser event to implement the `onChange` event. For the most part this behaves as expected, except when calling `preventDefault` in a `change` handler. `preventDefault` stops the browser from visually updating the input, even if `checked` gets toggled. This can be worked around either by removing the call to `preventDefault`, or putting the toggle of `checked` in a `setTimeout`.