Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions modules/ROOT/pages/events.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,24 @@ tinymce.init({
});
----

=== Example: content change callback

To run a callback when the editor content changes, use the `+Change+` event with `+editor.on()+` inside the `+setup+` option:

[source,js]
----
tinymce.init({
selector: 'textarea',
setup: (editor) => {
editor.on('change', () => {
console.log('Content was modified.');
});
}
});
----

The `+Change+` event fires when content changes are committed, such as when moving focus away from the editor. For real-time updates as the user types, use the `+input+` event instead.

[[browser-native-events]]
== Supported browser-native events

Expand Down
Loading