Skip to content

Commit

Permalink
Merge pull request #23135 from robertKozik/16098-selecting-chat-messa…
Browse files Browse the repository at this point in the history
…ge-and-pressing-any-key-focus-the-message-instead-of-switch-the-focus-to-the-composer

#22803 followup - update composer handlePaste conditions
  • Loading branch information
cristipaval authored Jul 22, 2023
2 parents b7d17e0 + 55d5fbd commit cd851d0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Composer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,18 @@ class Composer extends React.Component {
* @param {ClipboardEvent} event
*/
handlePaste(event) {
if (!this.props.checkComposerVisibility()) {
event.preventDefault();

const isVisible = this.props.checkComposerVisibility();
const isFocused = this.textInput.isFocused();

if (!(isVisible || isFocused)) {
return;
}

event.preventDefault();
if (this.textInput.id !== event.target.id) {
return;
}

const {files, types} = event.clipboardData;
const TEXT_HTML = 'text/html';
Expand Down

0 comments on commit cd851d0

Please sign in to comment.