Skip to content

Commit

Permalink
Made role on input field a property (#1553)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasknutsen authored and javivelasco committed Aug 2, 2017
1 parent 431abb1 commit fc9c180
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/input/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const factory = (FontIcon) => {
onFocus: PropTypes.func,
onKeyPress: PropTypes.func,
required: PropTypes.bool,
role: PropTypes.string,
rows: PropTypes.number,
theme: PropTypes.shape({
bar: PropTypes.string,
Expand Down Expand Up @@ -67,6 +68,7 @@ const factory = (FontIcon) => {
floating: true,
multiline: false,
required: false,
role: 'input',
type: 'text',
};

Expand Down Expand Up @@ -166,7 +168,7 @@ const factory = (FontIcon) => {

render() {
const { children, defaultValue, disabled, error, floating, hint, icon,
name, label: labelText, maxLength, multiline, required,
name, label: labelText, maxLength, multiline, required, role,
theme, type, value, onKeyPress, rows = 1, ...others } = this.props;
const length = maxLength && value ? value.length : 0;
const labelClassName = classnames(theme.label, { [theme.fixed]: !floating });
Expand All @@ -185,7 +187,7 @@ const factory = (FontIcon) => {
className: classnames(theme.inputElement, { [theme.filled]: valuePresent }),
onChange: this.handleChange,
ref: (node) => { this.inputNode = node; },
role: 'input',
role,
name,
defaultValue,
disabled,
Expand Down

0 comments on commit fc9c180

Please sign in to comment.