diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index 8dc9a43889e5..9d930d61797d 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -7862,6 +7862,9 @@ Map { "placeholder": Object { "type": "string", }, + "readOnly": Object { + "type": "bool", + }, "rows": Object { "type": "number", }, diff --git a/packages/react/src/components/TextArea/TextArea.js b/packages/react/src/components/TextArea/TextArea.js index 54ce4365e50d..6220f2c4e581 100644 --- a/packages/react/src/components/TextArea/TextArea.js +++ b/packages/react/src/components/TextArea/TextArea.js @@ -120,6 +120,7 @@ const TextArea = React.forwardRef(function TextArea( aria-invalid={invalid || null} aria-describedby={invalid ? errorId : null} disabled={other.disabled} + readOnly={other.readOnly} style={ other.cols ? {} @@ -142,7 +143,9 @@ const TextArea = React.forwardRef(function TextArea( {counter}
{invalid && !isFluid && ( @@ -250,6 +253,11 @@ TextArea.propTypes = { */ placeholder: PropTypes.string, + /** + * Whether the textarea should be read-only + */ + readOnly: PropTypes.bool, + /** * Specify the rows attribute for the `