mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 19:42:11 +10:00
Add autoFocus support
This commit is contained in:
parent
406866ffd5
commit
b144cfe94f
1 changed files with 4 additions and 1 deletions
|
|
@ -19,10 +19,11 @@ class InputField extends Component {
|
|||
type,
|
||||
label,
|
||||
placeholder,
|
||||
autoFocus,
|
||||
input,
|
||||
meta,
|
||||
} = this.props;
|
||||
const inputProps = { ...input, type, placeholder };
|
||||
const inputProps = { ...input, type, placeholder, autoFocus };
|
||||
const { pristine, valid, invalid, touched, error } = meta;
|
||||
|
||||
// Error message and input error styles are only shown if the
|
||||
|
|
@ -60,6 +61,7 @@ InputField.defaultProps = {
|
|||
clearOnUnmount: false,
|
||||
label: null,
|
||||
placeholder: null,
|
||||
autoFocus: false,
|
||||
};
|
||||
|
||||
const { string, shape, bool, func } = PropTypes;
|
||||
|
|
@ -78,6 +80,7 @@ InputField.propTypes = {
|
|||
type: string.isRequired,
|
||||
label: string,
|
||||
placeholder: string,
|
||||
autoFocus: bool,
|
||||
|
||||
// Objects created by redux-form
|
||||
input: shape({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue