Editor Events

Equivalent Trix Events: https://github.com/basecamp/trix/blob/main/README.md#observing-editor-changes

Events marked with checkmarks have been implemented. Events without checkmarks have not been implemented yet.

Direct Upload Events

(Thank you Matheus Rich for the inspiration!)

https://github.com/rails/rails/pull/52680

Direct Uploads now have the following events you can listen to in the editor. All of the events have the event.attachmentUpload property which should have all the information you need to react appropriately.

All of the above have a event.attachmentUpload which will contain various properties you need. Such as .progress, .attachment, etc.

For example, here’s how you would grab the progress of a direct upload:

JavaScript
document.querySelector("rhino-editor").addEventListener("rhino-direct-upload:progress", (event) => {
  console.log(event.attachmentUpload.progress)
})