We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4022c30 + 85df7b0 commit b8ec7f2Copy full SHA for b8ec7f2
frontend/block/view.ts
@@ -9,7 +9,7 @@ declare global {
9
}
10
11
12
-window.addEventListener('load', () => {
+window.addEventListener('DOMContentLoaded', () => {
13
const config = window.ChatrixBlockConfig;
14
if (!config) {
15
throw "ChatrixBlockConfig is not defined";
@@ -25,5 +25,6 @@ window.addEventListener('load', () => {
25
attributes: config.attributes,
26
};
27
28
- renderBlock(containerId, props);
+ // See https://github.com/Automattic/chatrix/issues/161 for why we use a timeout here.
29
+ setTimeout( () => renderBlock(containerId, props), 1 );
30
});
0 commit comments