Skip to content

Commit

Permalink
fix(atoms): pass onFocus to the input component
Browse files Browse the repository at this point in the history
  • Loading branch information
ej9x committed Jul 9, 2018
1 parent 6fcd43d commit 0562e9e
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/atoms/dataEntry/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class Input extends PureComponent<InputProps> {
hideErrorIndicator,
leftIcon,
mask,
onBlur,
onFocus,
placeholder,
rightIcon,
square,
Expand All @@ -95,7 +97,9 @@ class Input extends PureComponent<InputProps> {
hasError,
hasLeftIcon,
hasRightIcon,
onBlur,
onChange: this.onChange,
onFocus,
placeholder,
square,
type,
Expand Down
6 changes: 5 additions & 1 deletion src/atoms/dataEntry/InputField/InputField.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ const InputField = ({
...rest
}: InputFieldProps) => {
const { error, touched } = meta;
const { name, value, onChange } = input;
const { name, value, onChange, onFocus, onBlur } = input;
const hasError = !!error && !!touched;

console.log(hasError, error, touched);

return (
<FormField label={ label } stretch={ stretch } direction={ direction } hideErrorLabel={ hideErrorLabel } input={ input } meta={ meta }>
<Input
Expand All @@ -63,6 +65,8 @@ const InputField = ({
maxLength={ maxLength }
name={ name }
onChange={ onChange }
onFocus={ onFocus }
onBlur={ onBlur }
square={ square }
value={ value }
/>
Expand Down
2 changes: 2 additions & 0 deletions src/common/Tag/Tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const COLLECTED_PROPS = [
'label',
'name',
'onChange',
'onBlur',
'onFocus',
'onClick',
'onDoubleClick',
'onMouseDown',
Expand Down
Loading

0 comments on commit 0562e9e

Please sign in to comment.