Skip to content

Commit

Permalink
fix(atoms): pass type to input
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxuoz committed Jun 4, 2018
1 parent 812027d commit 65503e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
3 changes: 2 additions & 1 deletion src/atoms/dataEntry/Input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Input extends PureComponent<InputProps> {
}

render() {
const { hasError, hideErrorIndicator, autoComplete, stretch, errorText, leftIcon, rightIcon, mask, square, value, ...rest } = this.props;
const { hasError, hideErrorIndicator, autoComplete, stretch, errorText, leftIcon, rightIcon, mask, square, value, type, ...rest } = this.props;
const hasLeftIcon = !!leftIcon;
const hasRightIcon = !!rightIcon;

Expand All @@ -80,6 +80,7 @@ class Input extends PureComponent<InputProps> {
hasLeftIcon,
hasRightIcon,
autoComplete: autoComplete ? 'on' : 'off',
type,
};

return (
Expand Down
48 changes: 24 additions & 24 deletions storybook/__tests__/__snapshots__/storyshots.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2528,11 +2528,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Form without groups 1`] = `
<div
className="emotion-2"
name={undefined}
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand All @@ -2548,11 +2548,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Form without groups 1`] = `
<div
className="emotion-2"
name={undefined}
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand All @@ -2568,11 +2568,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Form without groups 1`] = `
<div
className="emotion-2"
name={undefined}
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand All @@ -2588,11 +2588,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Form without groups 1`] = `
<div
className="emotion-2"
name={undefined}
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand All @@ -2608,11 +2608,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Form without groups 1`] = `
<div
className="emotion-2"
name={undefined}
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -2687,11 +2687,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with error 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
<div
Expand Down Expand Up @@ -2747,11 +2747,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with html auto-complete 1`] = `
<div
className="emotion-1"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -2823,11 +2823,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with left icon 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
<div
Expand Down Expand Up @@ -2886,11 +2886,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with placeholder 1`] = `
className="emotion-1"
name="input"
placeholder="custom placeholder"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -2962,11 +2962,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with right icon 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
<div
Expand Down Expand Up @@ -3044,11 +3044,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with right icon and error 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
<div
Expand Down Expand Up @@ -3106,11 +3106,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with stretch=false 1`] = `
<div
className="emotion-1"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3163,11 +3163,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input with value 1`] = `
<div
className="emotion-1"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value="value"
/>
</div>
Expand Down Expand Up @@ -3220,11 +3220,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/Input without value 1`] = `
<div
className="emotion-1"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3335,11 +3335,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with error 1`] = `
<div
className="emotion-3"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
<div
Expand Down Expand Up @@ -3437,11 +3437,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with placeholder 1`] = `
className="emotion-2"
name="input"
placeholder="placeholder"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3526,11 +3526,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with row direction 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3615,11 +3615,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with row direction stretch=false
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3706,11 +3706,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with square input 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3795,11 +3795,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with stretch 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -3884,11 +3884,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField with value 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value="value"
/>
</div>
Expand Down Expand Up @@ -3962,11 +3962,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField without error label and indicato
<div
className="emotion-1"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -4039,11 +4039,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField without label 1`] = `
<div
className="emotion-1"
name="input"
type="text"
>
<input
className="emotion-0"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down Expand Up @@ -4128,11 +4128,11 @@ exports[`Storyshots ATOMS/DATA ENTRY/InputField without value 1`] = `
<div
className="emotion-2"
name="input"
type="text"
>
<input
className="emotion-1"
onChange={[Function]}
type="text"
value={undefined}
/>
</div>
Expand Down

0 comments on commit 65503e1

Please sign in to comment.