Performance on longer text with CKEditor

Created on 27 November 2023, 7 months ago

Problem/Motivation

I've noticed the issue with Textfield counter when text in the field is quite long and the CKEditor is enabled in this field.
It looks like on longer text - you can start see delay on entering the text and characters appear slower and lower, especially when you have edit form opened for longer time.

Steps to reproduce

1. Install and enable "Textfield Counter" module.
2. Configure form display for any content to have "Text area with counter" widget and set very high limit.
3. Enable "Count only mode", disable "Add javascript valdiation".
4. Make sure you are using HTML format with CKEditor enabled
5. Paste long text (I was testing on 60k characters) to the textarea and try to edit this text.

I've noticed that it can work fine for few minutes, but it begins to slow down more and more (probably depending on how long you are editing the text). At some point you can see that characters from your keyboard appear with the delay and at some point it's not possible to work anymore.
Sometimes reloading the form (save and edit again) helps and gives you few minutes, sometimes the issue occurs immediately after you click "edit" again. I think the problem occurs sooner if there is more HTML in text area.

After those test I changed form widget to "Textarea" (without the counter) and retested and this issue is not happening without the counter.

I was also checking CKEditor itself with large texts here: https://ckeditor.com/docs/ckeditor5/40.1.0/features/word-count.html, but I didn't see any similar problem.

I was testing on clean 10.1.6 with Textfield Counter 2.3.0, but had the same issue on Drupal 9.5.11

πŸ› Bug report
Status

Active

Version

2.3

Component

Code

Created by

πŸ‡΅πŸ‡±Poland besek

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024