Skip to content

Commit

Permalink
Delay constructing components in dev mode to make sure styles are loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaNarie committed Nov 15, 2017
1 parent cd24343 commit 588fee7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ function render(clean) {
// render page with data
div.innerHTML = appTemplate(getJsonData());

initComponents(div);
// giving the browser some time to inject the styles
// so when components are constructed, the styles are all applied
setTimeout(() => initComponents(div), 100);
}
}
document.addEventListener('DOMContentLoaded', () => {
Expand Down

0 comments on commit 588fee7

Please sign in to comment.