Skip to content

Commit

Permalink
found a better workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Aug 30, 2024
1 parent 10e67cc commit 0cdb4ea
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions nicegui/elements/scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default {

this.$nextTick(() => this.resize());
window.addEventListener("resize", this.resize, false);
window.addEventListener("DOMContentLoaded", this.resize, false);

const gridSize = this.grid[0] || 100;
const gridDivisions = this.grid[1] || 100;
Expand Down
1 change: 1 addition & 0 deletions nicegui/elements/scene_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export default {

this.$nextTick(() => this.resize());
window.addEventListener("resize", this.resize, false);
window.addEventListener("DOMContentLoaded", this.resize, false);

const render = () => {
requestAnimationFrame(() => setTimeout(() => render(), 1000 / 20));
Expand Down
6 changes: 0 additions & 6 deletions nicegui/static/nicegui.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,3 @@ for (let sheet of document.styleSheets) {
}
}
}

// HACK: prevent some elements from overflowing their containers
// Ex.: `ui.scene().classes('border-2 border-red-500 w-64')`
document.addEventListener("DOMContentLoaded", function () {
window.dispatchEvent(new Event("resize"));
});

0 comments on commit 0cdb4ea

Please sign in to comment.