From 445c940af4ddab8a61c7c17ad003674a578da0cc Mon Sep 17 00:00:00 2001 From: Eden Wang Date: Tue, 28 Feb 2017 11:30:04 +0800 Subject: [PATCH] docs: Change Password Blur from password to confirm (#5076) * Change Password Blur from password to confirm If you type check password, then type password, the validation won't be changed * rename variables and functions name rename handlePasswordBlur to handleConfirmBlur rename passwordDirty to confirmDirty --- components/form/demo/register.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/form/demo/register.md b/components/form/demo/register.md index 630fbca1fb..45d578db01 100644 --- a/components/form/demo/register.md +++ b/components/form/demo/register.md @@ -44,7 +44,7 @@ const residences = [{ class RegistrationForm extends React.Component { state = { - passwordDirty: false, + confirmDirty: false, }; handleSubmit = (e) => { e.preventDefault(); @@ -54,9 +54,9 @@ class RegistrationForm extends React.Component { } }); } - handlePasswordBlur = (e) => { + handleConfirmBlur = (e) => { const value = e.target.value; - this.setState({ passwordDirty: this.state.passwordDirty || !!value }); + this.setState({ confirmDirty: this.state.confirmDirty || !!value }); } checkPassword = (rule, value, callback) => { const form = this.props.form; @@ -68,7 +68,7 @@ class RegistrationForm extends React.Component { } checkConfirm = (rule, value, callback) => { const form = this.props.form; - if (value && this.state.passwordDirty) { + if (value && this.state.confirmDirty) { form.validateFields(['confirm'], { force: true }); } callback(); @@ -121,7 +121,7 @@ class RegistrationForm extends React.Component { validator: this.checkConfirm, }], })( - + )} + )}