Skip to content

const data = editor.getData() cause laggy when typing fast with large text #65

@hoqkhanh

Description

@hoqkhanh

My site is very slow when typing fast with Ckeditor
I investigated and saw that onChange event with editor.getData(); is root cause

onChange={(event, editor) => {
const data = editor.getData();
onChange( { target: { name, value: data } } );
);

I tried it with setTimeout function but still lag if the editor already has large text

onChange={(event, editor) => {
if (inputTimeout) {
window.clearTimeout(inputTimeout);
}
inputTimeout = setTimeout(
() => {
const data = editor.getData();
onChange( { target: { name, value: data } } );
},
5000
);
}}

Do you have any solution to solve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions