Fix unfocused paste handling and focus return for file uploads (#7625)

This commit is contained in:
Michael Telatynski
2022-01-26 09:04:19 +00:00
committed by GitHub
parent e53427fce3
commit 88cd2f8af7
4 changed files with 39 additions and 16 deletions

View File

@@ -160,7 +160,11 @@ class UploadButton extends React.Component<IUploadButtonProps> {
}
ContentMessages.sharedInstance().sendContentListToRoom(
tfiles, this.props.roomId, this.props.relation, MatrixClientPeg.get(),
tfiles,
this.props.roomId,
this.props.relation,
MatrixClientPeg.get(),
this.context.timelineRenderingType,
);
// This is the onChange handler for a file form control, but we're

View File

@@ -560,7 +560,11 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
// it puts the filename in as text/plain which we want to ignore.
if (clipboardData.files.length && !clipboardData.types.includes("text/rtf")) {
ContentMessages.sharedInstance().sendContentListToRoom(
Array.from(clipboardData.files), this.props.room.roomId, this.props.relation, this.props.mxClient,
Array.from(clipboardData.files),
this.props.room.roomId,
this.props.relation,
this.props.mxClient,
this.context.timelineRenderingType,
);
return true; // to skip internal onPaste handler
}