Document change event

Hello,

I’m having issues with change event, onDocumentStateChange does not track data instantly, means when I type or make changes, it triggers first time, later on it takes time to be triggered!
Have anyone faced this issue and was able to solve it?

Thank you for your time

Hello @mrzamzoum, :wave:

To better understand and reproduce the problem, could you please share the following:

  • The configuration used for initializing the editor (e.g., the config object passed to Docs API).
  • A short video or screenshots demonstrating the steps to reproduce the issue. This would also help other users visualize the problem.

Hello Nikolas, thank you for reaching out!
I’m using react with @onlyoffice/document-editor-react version 2.1.0.
I’m using onlyoffice/documentserver-de:latest on docker.

The returned component
<DocumentEditor
id={id}
documentServerUrl={documentServerUrl}
config={{ …(config as any) }}
events_onDocumentReady={handleDocumentReady}
events_onAppReady={handleAppReady}
events_onDocumentStateChange={handleDocumentStateChange}
/>

The config:
const config = {
document: {
fileType: “docx”,
key: id, // Unique document key
title: “Demo Document”,
url: “easy_pack/file-sample_100kB.docx at master · zamzoum94/easy_pack · GitHub”,
},
documentType: “word”,
editorConfig: {
mode: “edit”,
coEditing: {
mode: “fast”,
change: true,
},
},
permissions: {
edit: true,
},
};

The problem is when I type keywords, events_onDocumentStateChange does not get triggered every time

What this handleDocumentStateChange refers to? You implementation is not clear, please elaborate.

1 Like