Atelier Logo

Atelier

API Reference

Events

onChange, onBlur, onFocus, onReady — and their per-framework names.

Events

AngularReactVueVanillaPayload
ngModelChange or form control valueonChangeupdate:modelValue (via v-model)onChangeHTML string (CustomEvent.detail in React)
(form touched)onBlur@editor-bluronBlur
onFocus@editor-focusonFocus
(editorReady)onReady@editor-readyonReadyTiptap Editor instance

Storing content verbatim

The editor tracks its current HTML internally. Whatever onChange / editor-change gives you, store it exactly as received — never trim, reformat, or sanitize it in the change handler. Sanitize at save time instead:

// Wrong — any transformation here breaks content identity and can loop
onEditorChange(html: string): void {
  this.content = html.trim();
}

// Correct — store verbatim, sanitize only when you actually submit
onEditorChange(html: string): void {
  this.content = html;
}

saveToServer(): void {
  const safeHtml = DOMPurify.sanitize(this.content);
  this._api.save(safeHtml).subscribe();
}

See Preventing the infinite update loop for why this matters.

On this page