Skip to content

Commit

Permalink
Merge pull request #210 from maartentenham/support-text-plain-type-on…
Browse files Browse the repository at this point in the history
…-paste

Make onPaste also support text of type text/plain
  • Loading branch information
stevermeister authored Jul 22, 2024
2 parents 715bf7a + 5952206 commit 6c3fee3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions projects/ngx-wig/src/lib/ngx-wig.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,15 @@ export class NgxWigComponent
} else {
this.pasteHtmlAtCaret(changes['content'].currentValue);
}

}
}

onPaste(event: ClipboardEvent) {
event.preventDefault();
const text = event.clipboardData?.getData('text/html') ?? '';

const text = event.clipboardData?.getData('text/html') || event.clipboardData?.getData('text/plain') || '';

if (this._filterService){
this.pasteHtmlAtCaret(this._filterService.filter(text));
} else {
Expand Down

0 comments on commit 6c3fee3

Please sign in to comment.