Hi Lam,
If you wish to trim or change the pasted content into the Rich Text Editor component, you can remove the maxLength property, check the character counts, and trim the text as per your wish using the afterPasteCleanup event. Please find the below code and sample for your reference.
app.component.html
|
<ejs-richtexteditor (afterPasteCleanup)="afterPasteCleanup($event)">……… </ejs-richtexteditor> |
app.component.ts
|
public afterPasteCleanup(e: any): void { // Here, you can able to trim or change the copied content if (this.rteObj.getText().length > 500) { e.value = '<p>Changed or trimmed text</p>'; } } |
API link: https://ej2.syncfusion.com/angular/documentation/api/rich-text-editor#afterpastecleanup
Regards,
Buvana S
Hi Buvana S,
Thanks, for your support for me.
If remove the maxLength property, the customer will input the characters more than the maxlength. I don't want the customer could do it.
Can you support the afterPasteCleanup event emits an: error and value if the characters more than the maxlength. I trim the text copied content and executeCommand value for rich text.
Regards,
Lam
Hi Lam,
Currently, we are not allowed to paste content into Rich Text Editor content when it exceeds the maxLength property. So, we have considered “Need to indicate warning message when pasted content exceeds the maxLength property” as a uncertain feature request from our end and the fix will be included with any of our releases.
You can now track the current status of the report, review the proposed resolution timeline, and contact us for any further inquiries through this link:
Regards,
Buvana S
You're welcome! Please track the status of the feature in the below feedback link.