Skip to content

Commit a65a791

Browse files
committed
Fix #83: Set disabled attr on textarea
1 parent 39224d3 commit a65a791

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/components/form.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,11 @@ export class FormTextareaInput extends React.Component {
589589
props.ref = inputRef || this.inputRef;
590590
props.onChange = this.handleChange;
591591

592+
// readonly inputs are automatically marked disabled
593+
// if this is undesired, explicitly pass disabled=false
594+
if (props.readOnly && (props.disabled === undefined || props.disabled === null))
595+
props.disabled = true;
596+
592597
return (
593598
<div>
594599
<Label label={label} required={props.required} />

0 commit comments

Comments
 (0)