Skip to content

Commit 726fad3

Browse files
Force the display of the container to be block
If it is not `block`, its height will be 0 and nothing will be shown.
1 parent 4060ff3 commit 726fad3

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dev
66

77
Improvements:
88
- Overwrite the width/height if its computed value is `0px`
9+
- Force the display of the container to be `block`, if it is not `block`, its height will be 0 and nothing will be shown
910

1011
1.2.0
1112
-----

docs/build.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/graphics3d.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import { getUniformsBuffer } from './uniforms.js';
1818
function setDefaultContainerStyle(container) {
1919
const style = getComputedStyle(container);
2020

21-
if (!style.display) container.style.display = 'block';
21+
// This must be block, otherwise the height will be 0 and nothing will be
22+
// shown.
23+
container.style.display = 'block';
2224
if (!style.width || style.width === '0px') container.style.width = '65vw';
2325
if (!style.maxWidth) container.style.maxWidth = '400px';
2426
if (!style.height || style.height === '0px') container.style.height = '65vw';

0 commit comments

Comments
 (0)