This change improves the perceived performance by forcing the browser to insert a rendering pass before initializing the browser. In particular on mobile devices this creates an opportunity to refresh the screen.
await import("ckeditor5-bundle");
+ await new Promise((resolve) => {
+ window.requestAnimationFrame(resolve);
+ });
+
initializeFeatures(element, features);
if (features.attachment) {
throw new TypeError(`Cannot initialize the editor for '${element.id}' twice.`);
}
await new Promise((resolve_1, reject_1) => { require(["ckeditor5-bundle"], resolve_1, reject_1); }).then(tslib_1.__importStar);
+ await new Promise((resolve) => {
+ window.requestAnimationFrame(resolve);
+ });
initializeFeatures(element, features);
if (features.attachment) {
(0, Attachment_1.setup)(element);