Skip to content

Commit

Permalink
Merge pull request ant-design#6858 from lyz810/master
Browse files Browse the repository at this point in the history
fix: TextArea disabled style
  • Loading branch information
afc163 authored Jul 17, 2017
2 parents b7a1665 + bbfdc46 commit 09c8add
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/input/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ export default class TextArea extends React.Component<TextAreaProps & HTMLTextar
this.setState({ textareaStyles });
}

getTextAreaClassName() {
const { prefixCls, disabled } = this.props;
return classNames(prefixCls, {
[`${prefixCls}-disabled`]: disabled,
});
}

handleTextareaChange = (e) => {
if (!('value' in this.props)) {
this.resizeTextarea();
Expand Down Expand Up @@ -118,7 +125,7 @@ export default class TextArea extends React.Component<TextAreaProps & HTMLTextar
return (
<textarea
{...otherProps}
className={classNames(props.prefixCls, props.className)}
className={classNames(this.getTextAreaClassName(), props.className)}
style={style}
onKeyDown={this.handleKeyDown}
onChange={this.handleTextareaChange}
Expand Down

0 comments on commit 09c8add

Please sign in to comment.