From b144cfe94fd2bfffc11f83d9c4f3a6d74c5df8dd Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Tue, 6 Jun 2017 11:22:17 +0300 Subject: [PATCH] Add autoFocus support --- src/components/InputField/InputField.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/InputField/InputField.js b/src/components/InputField/InputField.js index cb8b9da7..58ec3895 100644 --- a/src/components/InputField/InputField.js +++ b/src/components/InputField/InputField.js @@ -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({