kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Allow to paste attachments in chat box
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>environments/review-develop-3zknud/deployments/673^2
rodzic
e7cefaa6ed
commit
d7967882a0
|
@ -97,6 +97,12 @@ const ChatBox: React.FC<IChatBox> = ({ chatId, onSetInputRef, autosize }) => {
|
||||||
setContent(e.target.value);
|
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 = () => {
|
const markRead = () => {
|
||||||
dispatch(markChatRead(chatId));
|
dispatch(markChatRead(chatId));
|
||||||
};
|
};
|
||||||
|
@ -182,6 +188,7 @@ const ChatBox: React.FC<IChatBox> = ({ chatId, onSetInputRef, autosize }) => {
|
||||||
placeholder={intl.formatMessage(messages.placeholder)}
|
placeholder={intl.formatMessage(messages.placeholder)}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
onChange={handleContentChange}
|
onChange={handleContentChange}
|
||||||
|
onPaste={handlePaste}
|
||||||
value={content}
|
value={content}
|
||||||
ref={setInputRef}
|
ref={setInputRef}
|
||||||
/>
|
/>
|
||||||
|
|
Ładowanie…
Reference in New Issue