Skip to content

Commit

Permalink
fix(Input): make plaintext output input by default (#1226)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: previously plaintext on Input would output a 'p' tag. To better line up with bootstrap it will not output an 'input' tag. If you need a 'p' tag, provide tag="p" prop

Closes #1225
  • Loading branch information
TheSharpieOne committed Sep 17, 2018
1 parent 35b4dd7 commit ff64c76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Input extends React.Component {

if (plaintext || staticInput) {
formControlClass = `${formControlClass}-plaintext`;
Tag = tag || 'p';
Tag = tag || 'input';
} else if (fileInput) {
formControlClass = `${formControlClass}-file`;
} else if (checkInput) {
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/Input.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ describe('Input', () => {
expect(wrapper.type()).toBe('textarea');
});

it('should render with "p" tag when plaintext prop is truthy', () => {
it('should render with "input" tag when plaintext prop is truthy', () => {
const wrapper = shallow(<Input type="select" plaintext />);

expect(wrapper.type()).toBe('p');
expect(wrapper.type()).toBe('input');
});

it('should render with "form-control-plaintext" class when plaintext prop is truthy', () => {
Expand Down

0 comments on commit ff64c76

Please sign in to comment.