> For the complete documentation index, see [llms.txt](https://docs.wproofreader.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wproofreader.com/v6.10.0.0/integrations/how-tos/replace-action-is-not-captured-in-ckeditor-onchange-event.md).

# Replace action is not captured in CKEditor onChange event

#### Description of the use case <a href="#replaceactionisnotcapturedinckeditoronchangeevent-descriptionoftheusecase" id="replaceactionisnotcapturedinckeditoronchangeevent-descriptionoftheusecase"></a>

Right at this moment, when a user clicks on the suggestion, our editor needs to know (programatically) that something has changed in the original text. Unfortunately, these events are NOT captured in the onChange event of the CKEditor editor.&#x20;

#### Solution <a href="#replaceactionisnotcapturedinckeditoronchangeevent-solution" id="replaceactionisnotcapturedinckeditoronchangeevent-solution"></a>

To track the changes in the original text programmatically, you can use the **data.action** attribute. Here is an example:

```javascript
window.WEBSPELLCHECKER_CONFIG = {
    ...
    onStatistics: function(data, instance) {
        if (data.action !== 'replace') {
            return;
        }
        // React somehow on the `replace` action inside the editable field.
    },
    ...
}
```

Check [Configuration reference](https://webspellchecker.com/docs/api/wscbundle/Options.html) to see all the available WProofreader configuration options and methods.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wproofreader.com/v6.10.0.0/integrations/how-tos/replace-action-is-not-captured-in-ckeditor-onchange-event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
