From 9151ed1d517ead73f50c33aa8cff07a0a0350d9f Mon Sep 17 00:00:00 2001 From: Kirill Dushenkin Date: Fri, 5 Apr 2024 16:46:39 +0300 Subject: [PATCH 1/3] bugfix: missed readOnly prop (#57) Co-authored-by: Kirill Dushenkin --- src/TextArea.tsx | 3 +++ tests/allowClear.test.tsx | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/src/TextArea.tsx b/src/TextArea.tsx index 733fd83..9f056ee 100644 --- a/src/TextArea.tsx +++ b/src/TextArea.tsx @@ -35,6 +35,7 @@ const TextArea = React.forwardRef( classNames, styles, onResize, + readOnly, ...rest }, ref, @@ -232,6 +233,7 @@ const TextArea = React.forwardRef( }, }} hidden={hidden} + readOnly={readOnly} > ( prefixCls={prefixCls} onResize={handleResize} ref={resizableTextAreaRef} + readOnly={readOnly} /> ); diff --git a/tests/allowClear.test.tsx b/tests/allowClear.test.tsx index 0bc6ed8..d8634bf 100644 --- a/tests/allowClear.test.tsx +++ b/tests/allowClear.test.tsx @@ -104,6 +104,15 @@ describe('should support allowClear', () => { container.querySelector('.rc-textarea-clear-icon-hidden'), ).toBeTruthy(); }); + + it('should not support allowClear when it is readOnly', () => { + const { container } = render( +