Fix artifacts (bg, ...) when pasting content
This commit is contained in:
parent
963b71d020
commit
9a488b50b7
@ -4,6 +4,7 @@
|
|||||||
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import findUpAttribute from "../helpers/dom/findUpAttribute";
|
||||||
import getRichValue from "../helpers/dom/getRichValue";
|
import getRichValue from "../helpers/dom/getRichValue";
|
||||||
import isInputEmpty from "../helpers/dom/isInputEmpty";
|
import isInputEmpty from "../helpers/dom/isInputEmpty";
|
||||||
import { debounce } from "../helpers/schedulers";
|
import { debounce } from "../helpers/schedulers";
|
||||||
@ -12,7 +13,7 @@ import RichTextProcessor from "../lib/richtextprocessor";
|
|||||||
|
|
||||||
let init = () => {
|
let init = () => {
|
||||||
document.addEventListener('paste', (e) => {
|
document.addEventListener('paste', (e) => {
|
||||||
if(!(e.target as HTMLElement).hasAttribute('contenteditable') && !(e.target as HTMLElement).parentElement.hasAttribute('contenteditable')) {
|
if(!findUpAttribute(e.target, 'contenteditable="true"')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//console.log('document paste');
|
//console.log('document paste');
|
||||||
|
Loading…
Reference in New Issue
Block a user