How do I remove a white border that only pops on my ThreeJS webpage in mobile view?

Viewed 32

I thought it might be a resizing window issue, for which I wrote a JS function, but that didn't seem to be the case. Any suggestions?

/if the user resizes the window, the camera and renderer are updated
function onWindowResize() {
  camera.aspect = window.innerWidth / window.innerHeight;
  camera.updateProjectionMatrix();
  renderer.setSize(window.innerWidth, window.innerHeight);
}
onWindowResize();
window.addEventListener('resize', onWindowResize);

Example of White Border

1 Answers

You can try removing onWindowResize() and run again.

Related