Skip to content

Commit

Permalink
GF-320: Add autocomplete off for Profile passwords inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
SvetlanaBatova authored and levenkov committed Mar 23, 2021
1 parent 0dc774b commit a53aaad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/v1/components/FormField/FormField.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default class FormField extends Component {

render() {
const {
hasError, id, disabled, type, value, onChange, placeholder, errorText,
hasError, id, disabled, type, value, onChange, placeholder, errorText, autocomplete,
} = this.props;
const inputClass = `form__input${type === 'number' ? ' form__input-number' : ''}`;
return (
Expand All @@ -27,6 +27,7 @@ export default class FormField extends Component {
onChange={onChange}
onKeyPress={this.onKeyPress}
placeholder={placeholder}
autocomplete={autocomplete}
/>
<label
htmlFor={id}
Expand Down Expand Up @@ -62,6 +63,7 @@ FormField.propTypes = {
PropTypes.string.isRequired,
PropTypes.number.isRequired,
]),
autocomplete: PropTypes.string,
};

FormField.defaultProps = {
Expand All @@ -70,4 +72,5 @@ FormField.defaultProps = {
disabled: false,
onChange: null,
errorText: null,
autocomplete: null,
};
4 changes: 4 additions & 0 deletions src/v2/forms/Profile/Profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ class Profile extends Component {
</div>
</div>
<div className="modal-block__padding-wrapper">
<input type="text" style={{display: 'none'}} />
<input type="password" style={{display: 'none'}} />
<FormField
placeholder="Имя"
id="name"
Expand All @@ -429,6 +431,7 @@ class Profile extends Component {
? 'Задать пароль'
: 'Сменить пароль'
}
autocomplete="new-password"
onChange={this.onPasswordChange}
type="password"
hasError={this.hasError('password')}
Expand All @@ -443,6 +446,7 @@ class Profile extends Component {
hasError={this.hasError('repeatPassword')}
errorText={this.errorText('repeatPassword')}
value={repeatPassword}
autocomplete="new-password"
/>
<FormField
placeholder="Email"
Expand Down

0 comments on commit a53aaad

Please sign in to comment.