Skip to content

Commit

Permalink
The field's value is now passed as a prop and it has a new-password a…
Browse files Browse the repository at this point in the history
…s it's default value
  • Loading branch information
mktoast committed Jul 5, 2018
1 parent 9d35c65 commit 100b5c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ This changelog references the relevant changes done between versions.
To get the diff for a specific change, go to https://github.com/LIN3S/FrontFoundation/commit/XXX where XXX is the change hash
To get the diff between two versions, go to https://github.com/LIN3S/FrontFoundation/compare/v0.5.0...v0.6.0

* 0.19.2
* The `autocomplete` field's value is now passed as a prop and it has a "new-password" as it's default value.
* 0.19.1
* Added the `validatory` dependency as a peerDependency.
* 0.19.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lin3s-front-foundation",
"version": "0.19.1",
"version": "0.19.2",
"author": "LIN3S",
"license": "MIT",
"description": "Library that provides a sort of commonly used front-end components in LIN3S projects",
Expand Down
8 changes: 5 additions & 3 deletions src/js/ui/react/components/FormGroupInput/FormGroupInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import PropTypes from 'prop-types';
class FormGroup extends React.Component {

static propTypes = {
autoComplete: PropTypes.string,
enabled: PropTypes.bool,
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
Expand All @@ -34,9 +35,9 @@ class FormGroup extends React.Component {
};

static defaultProps = {
autoComplete: 'new-password', // This will prevent the browsers to autoComplete the input.
enabled: true,
onChanged: () => {
},
onChanged: () => {},
placeholder: '',
required: false,
type: 'text',
Expand Down Expand Up @@ -90,6 +91,7 @@ class FormGroup extends React.Component {

render() {
const {
autoComplete,
enabled,
id,
label,
Expand All @@ -116,7 +118,7 @@ class FormGroup extends React.Component {
</label>
</div>
<input
autoComplete="off"
autoComplete={autoComplete}
className="form-input"
data-validate={validationEnabled ? true : null}
data-validate-pattern={validationEnabled ? validationPattern : null}
Expand Down

0 comments on commit 100b5c9

Please sign in to comment.