Skip to content

Commit

Permalink
feat(input): set the default row amount for multiline inputs to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSelg committed Aug 4, 2016
1 parent a8dbad1 commit 056cd6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/input/Input.js
Expand Up @@ -134,7 +134,7 @@ const factory = (FontIcon) => {
&& value !== ''
&& !(typeof value === Number && isNaN(value));

const InputElement = React.createElement(multiline ? 'textarea' : 'input', {
const inputElementProps = {
...others,
className: classnames(theme.inputElement, {[theme.filled]: valuePresent}),
onChange: this.handleChange,
Expand All @@ -145,7 +145,9 @@ const factory = (FontIcon) => {
required,
type,
value
});
};
if (multiline) inputElementProps.rows = 1; // set initial height to 1
const InputElement = React.createElement(multiline ? 'textarea' : 'input', inputElementProps);

return (
<div data-react-toolbox='input' className={className}>
Expand Down

0 comments on commit 056cd6d

Please sign in to comment.