Improved WYSIWYG code block behaviour via range of fixes

- Fixed issues with new code blocks breaking or acting odd due to
  misnamed contenteditable attribute.
- Helped fix issue where code blocks may show in a strage blank state
  due to timing within shadow dom loading.
- Fixed some function timing issues where some functions required their
  async predecessor to have finished.

Tested rather heavily in firefox and brave.
Fixes #3292
This commit is contained in:
Dan Brown
2022-02-27 17:18:08 +00:00
parent 06f694bad2
commit 0de4d6d223
2 changed files with 27 additions and 11 deletions

View File

@ -59,12 +59,10 @@ class CodeEditor {
this.languageInput.value = language;
this.callback = callback;
this.show();
this.updateEditorMode(language);
window.importVersioned('code').then(Code => {
Code.setContent(this.editor, code);
});
this.show()
.then(() => this.updateEditorMode(language))
.then(() => window.importVersioned('code'))
.then(Code => Code.setContent(this.editor, code));
}
async show() {