diff --git a/packages/strapi-helper-plugin/lib/src/components/Input/index.js b/packages/strapi-helper-plugin/lib/src/components/Input/index.js index 4ee3547ab1..b5c7338ee8 100644 --- a/packages/strapi-helper-plugin/lib/src/components/Input/index.js +++ b/packages/strapi-helper-plugin/lib/src/components/Input/index.js @@ -20,6 +20,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel errors: [], hasInitialValue: false, showPassword: false, + isFocus: false, }; } @@ -65,6 +66,24 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel this.props.onChange({ target }); } + handleBlurEmail = (e) => { + this.setState({ isFocus: !this.state.isFocus }); + + if (this.props.handleBlur) { + this.props.handleBlur(e); + } else { + this.handleBlur(e); + } + } + + handleFocusEmail = (e) => { + this.setState({ isFocus: !this.state.isFocus }); + + if (this.props.onFocus) { + this.props.onFocus(e); + } + } + handleToggle = (e) => { const target = { type: 'toggle', @@ -180,7 +199,7 @@ class Input extends React.Component { // eslint-disable-line react/prefer-statel
- + {(placeholder) => (