angular-editor icon indicating copy to clipboard operation
angular-editor copied to clipboard

Paste as a plain text

Open siva-pydakula opened this issue 4 years ago • 2 comments

@kolkov how can I paste as a plain text in the angular editor can you please guide me

siva-pydakula avatar Mar 27 '21 18:03 siva-pydakula

Can anyone reply for the above

siva-pydakula avatar Apr 04 '21 04:04 siva-pydakula

You'll get no answer to your question because there's no place where you can ask such a question than here, and NO CONTRIBUTOR is going to waste his time answering you.

You've got two ways:

  1. Fork from current (or any older branch) from this repository, modify src code once in your file system, try to build and replace all references in your app to your modified library. That means you'll have to deal with a lot of other issues and still no answer anywhere you ask.

  2. Try to catch the paste event outside this object but in your project. There are many ways to try. Maybe it works adding an event handler in your html template:

<angular-editor (focus)="focus($event)"></angular-editor>

and then adding an event listener in your ts component file:

focus($event) {
        event.addEventListener("paste", ($event: any) => {
        $event.preventDefault();
        const text = $event.clipboardData.getData("text/plain");
        window.document.execCommand("insertText", false, text);
      });

Anyway you're going to scratch your head until you get bald. And be grateful to the universe as I have read your question today, because else way you'll have no answer. Ever.

JosepAlacid avatar Sep 19 '21 12:09 JosepAlacid