ChatTextarea: pass ref to child
Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1390
This commit is contained in:
parent
47561e5c01
commit
67ffe9609f
1 changed files with 4 additions and 4 deletions
|
@ -14,13 +14,13 @@ interface IChatTextarea extends React.ComponentProps<typeof Textarea> {
|
|||
}
|
||||
|
||||
/** Custom textarea for chats. */
|
||||
const ChatTextarea: React.FC<IChatTextarea> = ({
|
||||
const ChatTextarea: React.FC<IChatTextarea> = React.forwardRef(({
|
||||
attachments,
|
||||
onDeleteAttachment,
|
||||
uploadCount = 0,
|
||||
uploadProgress = 0,
|
||||
...rest
|
||||
}) => {
|
||||
}, ref) => {
|
||||
const isUploading = uploadCount > 0;
|
||||
|
||||
const handleDeleteAttachment = (i: number) => {
|
||||
|
@ -64,9 +64,9 @@ const ChatTextarea: React.FC<IChatTextarea> = ({
|
|||
</HStack>
|
||||
)}
|
||||
|
||||
<Textarea theme='transparent' {...rest} />
|
||||
<Textarea ref={ref} theme='transparent' {...rest} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
export default ChatTextarea;
|
||||
|
|
Loading…
Reference in a new issue