Skip to content

Commit

Permalink
Fix TextField type prop for antd (closes vazco#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
purplecones committed Sep 13, 2017
1 parent eabd0d8 commit da5a921
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/uniforms-antd/__tests__/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,10 @@ test('<TextField> - renders a wrapper with unknown props', () => {
expect(wrapper.find(Input).prop('data-y')).toBe('y');
expect(wrapper.find(Input).prop('data-z')).toBe('z');
});

test('<TextField> - renders a input with correct type prop', () => {
const element = <TextField name="x" type="password" />;
const wrapper = mount(element, createContext({x: {type: String}}));

expect(wrapper.find(Input).prop('type')).toBe('password');
});
1 change: 1 addition & 0 deletions packages/uniforms-antd/src/TextField.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const Text = props =>
placeholder={props.placeholder}
ref={props.inputRef}
value={props.value}
type={props.type}
{...filterDOMProps(props)}
/>
))
Expand Down

0 comments on commit da5a921

Please sign in to comment.