Fix resetting formatting again
Temporarily disable copying with formatting
This commit is contained in:
parent
f9e4c7ab16
commit
1a4e7e5e1c
|
@ -1967,7 +1967,11 @@ export default class ChatInput {
|
||||||
// * so have to reset formatting
|
// * so have to reset formatting
|
||||||
if(document.activeElement === this.messageInput) {
|
if(document.activeElement === this.messageInput) {
|
||||||
// document.execCommand('styleWithCSS', false, 'true');
|
// document.execCommand('styleWithCSS', false, 'true');
|
||||||
|
setTimeout(() => {
|
||||||
|
if(document.activeElement === this.messageInput) {
|
||||||
this.resetCurrentFormatting();
|
this.resetCurrentFormatting();
|
||||||
|
}
|
||||||
|
}, 0);
|
||||||
// document.execCommand('styleWithCSS', false, 'false');
|
// document.execCommand('styleWithCSS', false, 'false');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -4,13 +4,15 @@
|
||||||
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
* https://github.com/morethanwords/tweb/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import SelectionSaver from "../selectionSaver";
|
import { copyTextToClipboard } from "../clipboard";
|
||||||
import selectElementContents from "./selectElementContents";
|
// import SelectionSaver from "../selectionSaver";
|
||||||
|
// import selectElementContents from "./selectElementContents";
|
||||||
|
|
||||||
export default function copyFromElement(element: HTMLElement) {
|
export default function copyFromElement(element: HTMLElement) {
|
||||||
const saver = new SelectionSaver();
|
copyTextToClipboard(element.textContent);
|
||||||
saver.save();
|
// const saver = new SelectionSaver();
|
||||||
selectElementContents(element);
|
// saver.save();
|
||||||
document.execCommand('copy');
|
// selectElementContents(element);
|
||||||
saver.restore();
|
// document.execCommand('copy');
|
||||||
|
// saver.restore();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user