Merge branch 'chat-paste' into 'develop'
Allow to paste attachments to the chat box textarea See merge request soapbox-pub/soapbox-fe!1691
This commit is contained in:
commit
018bf3705b
1 changed files with 7 additions and 0 deletions
|
@ -97,6 +97,12 @@ const ChatBox: React.FC<IChatBox> = ({ chatId, onSetInputRef, autosize }) => {
|
|||
setContent(e.target.value);
|
||||
};
|
||||
|
||||
const handlePaste: React.ClipboardEventHandler<HTMLTextAreaElement> = (e) => {
|
||||
if (!canSubmit() && e.clipboardData && e.clipboardData.files.length === 1) {
|
||||
handleFiles(e.clipboardData.files);
|
||||
}
|
||||
};
|
||||
|
||||
const markRead = () => {
|
||||
dispatch(markChatRead(chatId));
|
||||
};
|
||||
|
@ -182,6 +188,7 @@ const ChatBox: React.FC<IChatBox> = ({ chatId, onSetInputRef, autosize }) => {
|
|||
placeholder={intl.formatMessage(messages.placeholder)}
|
||||
onKeyDown={handleKeyDown}
|
||||
onChange={handleContentChange}
|
||||
onPaste={handlePaste}
|
||||
value={content}
|
||||
ref={setInputRef}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue