Merge pull request #15948 from ramonlsouza/copy-paste-workaround

fix: copy & paste does not work if whiteboard is visible
This commit is contained in:
Ramón Souza 2022-11-03 16:25:35 -03:00 committed by GitHub
commit ed24cdddde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 1 deletions

View File

@ -226,6 +226,9 @@ class MessageForm extends PureComponent {
onChange={this.handleMessageChange} onChange={this.handleMessageChange}
onKeyDown={this.handleMessageKeyDown} onKeyDown={this.handleMessageKeyDown}
async async
onPaste={(e) => { e.stopPropagation(); }}
onCut={(e) => { e.stopPropagation(); }}
onCopy={(e) => { e.stopPropagation(); }}
/> />
<Styled.SendButton <Styled.SendButton
hideLabel hideLabel

View File

@ -351,6 +351,9 @@ class MessageForm extends PureComponent {
value={message} value={message}
onChange={this.handleMessageChange} onChange={this.handleMessageChange}
onKeyDown={this.handleMessageKeyDown} onKeyDown={this.handleMessageKeyDown}
onPaste={(e) => { e.stopPropagation(); }}
onCut={(e) => { e.stopPropagation(); }}
onCopy={(e) => { e.stopPropagation(); }}
async async
/> />
{ENABLE_EMOJI_PICKER && this.renderEmojiButton()} {ENABLE_EMOJI_PICKER && this.renderEmojiButton()}

View File

@ -115,6 +115,9 @@ class ExternalVideoModal extends Component {
placeholder={intl.formatMessage(intlMessages.urlInput)} placeholder={intl.formatMessage(intlMessages.urlInput)}
disabled={sharing} disabled={sharing}
aria-describedby="exernal-video-note" aria-describedby="exernal-video-note"
onPaste={(e) => { e.stopPropagation(); }}
onCut={(e) => { e.stopPropagation(); }}
onCopy={(e) => { e.stopPropagation(); }}
/> />
</label> </label>
<Styled.ExternalVideoNote id="external-video-note"> <Styled.ExternalVideoNote id="external-video-note">

View File

@ -544,6 +544,9 @@ class Poll extends Component {
data-test="pollOptionItem" data-test="pollOptionItem"
onChange={(e) => this.handleInputChange(e, i)} onChange={(e) => this.handleInputChange(e, i)}
maxLength={MAX_INPUT_CHARS} maxLength={MAX_INPUT_CHARS}
onPaste={(e) => { e.stopPropagation(); }}
onCut={(e) => { e.stopPropagation(); }}
onCopy={(e) => { e.stopPropagation(); }}
/> />
{optList.length > MIN_OPTIONS_LENGTH && ( {optList.length > MIN_OPTIONS_LENGTH && (
<Styled.DeletePollOptionButton <Styled.DeletePollOptionButton
@ -785,7 +788,9 @@ class Poll extends Component {
data-test="pollQuestionArea" data-test="pollQuestionArea"
value={customInput ? questionAndOptions : question} value={customInput ? questionAndOptions : question}
onChange={(e) => this.handleTextareaChange(e)} onChange={(e) => this.handleTextareaChange(e)}
onPaste={() => this.setState({ isPasting: true })} onPaste={(e) => { e.stopPropagation(); this.setState({ isPasting: true }); }}
onCut={(e) => { e.stopPropagation(); }}
onCopy={(e) => { e.stopPropagation(); }}
onKeyPress={(event) => { onKeyPress={(event) => {
if (event.key === 'Enter' && customInput) { if (event.key === 'Enter' && customInput) {
this.handlePollLetterOptions(); this.handlePollLetterOptions();

View File

@ -194,6 +194,9 @@ class Polling extends Component {
placeholder={intl.formatMessage(intlMessages.responsePlaceholder)} placeholder={intl.formatMessage(intlMessages.responsePlaceholder)}
maxLength={MAX_INPUT_CHARS} maxLength={MAX_INPUT_CHARS}
ref={(r) => { this.responseInput = r; }} ref={(r) => { this.responseInput = r; }}
onPaste={(e) => { e.stopPropagation(); }}
onCut={(e) => { e.stopPropagation(); }}
onCopy={(e) => { e.stopPropagation(); }}
/> />
<Styled.SubmitVoteButton <Styled.SubmitVoteButton
data-test="submitAnswer" data-test="submitAnswer"