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