fix(browser-extension): issue #943
This commit is contained in:
parent
91755a8cbb
commit
a777434666
@ -136,22 +136,6 @@ function inputKeyDownHandler(event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @description Input paste handler
|
|
||||||
* @param {ClipboardEvent} event
|
|
||||||
*/
|
|
||||||
function inputPasteHandler(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
|
|
||||||
const text = event.clipboardData?.getData('text').replace(/\r?\n|\r/g, ' ');
|
|
||||||
const selection = window.getSelection();
|
|
||||||
|
|
||||||
if (selection.rangeCount) {
|
|
||||||
selection.deleteFromDocument();
|
|
||||||
selection.getRangeAt(0).insertNode(document.createTextNode(text));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description Show report dialog
|
* @description Show report dialog
|
||||||
*/
|
*/
|
||||||
@ -184,11 +168,9 @@ function showReportDialog() {
|
|||||||
link.setAttribute('rel', 'stylesheet');
|
link.setAttribute('rel', 'stylesheet');
|
||||||
reasonInput.addEventListener('input', inputChangeHandler);
|
reasonInput.addEventListener('input', inputChangeHandler);
|
||||||
reasonInput.addEventListener('keydown', inputKeyDownHandler);
|
reasonInput.addEventListener('keydown', inputKeyDownHandler);
|
||||||
reasonInput.addEventListener('paste', inputPasteHandler);
|
|
||||||
submitButton.addEventListener('click', submitButtonClickHandler);
|
submitButton.addEventListener('click', submitButtonClickHandler);
|
||||||
urlInput.addEventListener('input', inputChangeHandler);
|
urlInput.addEventListener('input', inputChangeHandler);
|
||||||
urlInput.addEventListener('keydown', inputKeyDownHandler);
|
urlInput.addEventListener('keydown', inputKeyDownHandler);
|
||||||
urlInput.addEventListener('paste', inputPasteHandler);
|
|
||||||
|
|
||||||
dispatch({ type: 'INSERT_DIALOG_CSS' });
|
dispatch({ type: 'INSERT_DIALOG_CSS' });
|
||||||
document.body.appendChild(dialog);
|
document.body.appendChild(dialog);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user