diff --git a/CHANGELOG.md b/CHANGELOG.md index 0107360b..2dfa95d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Add verification if the user's document is filled with the blockDocument property ## [2.15.0] - 2021-11-04 diff --git a/react/ProfileField.js b/react/ProfileField.js index f1d8e393..d2d6ea2b 100644 --- a/react/ProfileField.js +++ b/react/ProfileField.js @@ -20,7 +20,7 @@ class ProfileField extends Component { const error = data.touched ? applyValidation(field, value) : null const maskedValue = applyMask(field, value) - onFieldUpdate({ [field.name]: { ...data, value: maskedValue, error } }) + onFieldUpdate({ [field.name]: { ...data, value: maskedValue, error, active: true }}) } handleBlur = () => { @@ -37,8 +37,8 @@ class ProfileField extends Component { render() { const { field, data, options, Input, userProfile, blockDocument } = this.props - if(blockDocument && field.name === 'document' && userProfile['document'].value !== null){ - field.disabled = true + if(blockDocument && field.name === 'document' && userProfile.document.value.length >= 14 && !userProfile.document.hasOwnProperty('active')) { + field.disabled = true } return (