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
34 changes: 27 additions & 7 deletions modules/ROOT/partials/integrations/svelte-tech-ref.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Covered in this section:

* xref:supported-versions[Supported versions]
* xref:configuring-the-tinymce-svelte-integration[Configuring the {productname} Svelte integration]
** xref:apikey[apiKey]
** xref:licensekey[licenseKey]
Expand All @@ -13,6 +14,7 @@ Covered in this section:
* xref:component-binding[Component binding]
* xref:event-binding[Event binding]


[[configuring-the-tinymce-svelte-integration]]
== Configuring the {productname} Svelte integration

Expand Down Expand Up @@ -254,9 +256,9 @@ let text = '';

Functions can be bound to editor events, such as:

[source,jsx]
[source,svelte]
----
<Editor on:resizeeditor={this.handlerFunction} />
<Editor resizeeditor={handlerFunction} />
----

When the handler is called (*handlerFunction* in this example), it is called with two arguments:
Expand All @@ -265,8 +267,26 @@ When the handler is called (*handlerFunction* in this example), it is called wit

`+editor+`:: A reference to the editor.

=== Example of event binding

[source,svelte]
----
<script>
import Editor from '@tinymce/tinymce-svelte';

function eventHandler(event, editor) {
console.log('Editor event:', event);
console.log('Editor instance:', editor);
}
</script>

<main>
<Editor resizeeditor={this.eventHandler} />
</main>
----

[TIP]
Ensure event names are specified in lower-case (event names are case-sensitive).
Specify event names in lower-case (event names are case-sensitive).

The following events are available:

Expand All @@ -282,10 +302,10 @@ The following events are available:
* `+change+`
* `+clearundos+`
* `+click+`
* `+CommentChange+`
* `+CompositionEnd+`
* `+CompositionStart+`
* `+CompositionUpdate+`
* `+commentchange+`
* `+compositionend+`
* `+compositionstart+`
* `+compositionupdate+`
* `+contextmenu+`
* `+copy+`
* `+cut+`
Expand Down
Loading