Skip to content

Commit

Permalink
fix(pat textareamimetypeselector): Async initialization of textareas.…
Browse files Browse the repository at this point in the history
… Fixes TinyMCE in modals not showing up (see mosaic)
  • Loading branch information
petschki committed Apr 21, 2023
1 parent c957bdb commit c6d359c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pat/textareamimetypeselector/textareamimetypeselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ export default Base.extend({
"text/html": { pattern: "tinymce", patternOptions: {} },
},
},
init() {
this.el.addEventListener("input", (e) => this.init_textareas(e.target.value));
this.init_textareas(this.el.value);

async init() {
this.el.addEventListener("input", async (e) => await this.init_textareas(e.target.value));
await this.init_textareas(this.el.value);
},
init_textareas(mimetype) {

async init_textareas(mimetype) {
const pattern_config = this.options.widgets[mimetype];

// there might be more than one textareas with the same name
Expand Down

0 comments on commit c6d359c

Please sign in to comment.