Skip to content

Commit

Permalink
fix(trix): fix tric editor config loading
Browse files Browse the repository at this point in the history
  • Loading branch information
welcoMattic committed Sep 18, 2023
1 parent 0435cd8 commit 47fc9a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/field-text-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import Trix from 'trix/dist/trix';
// Provide Trix variable globally to allow custom backend pages to use it
window.Trix = Trix;

document.addEventListener('DOMContentLoaded', () => {
// Listening to the DOMLoadedContent event is too late because the Trix editor is already initialized.
// To be sure to handle properly the custom configuration, we have to to listen to the trix-before-initialize event.
document.addEventListener('trix-before-initialize', () => {
new TextEditorField();
});

Expand Down

0 comments on commit 47fc9a1

Please sign in to comment.