MikaFil commited on
Commit
a0b5ec0
·
verified ·
1 Parent(s): 44fa499

Update viewer.js

Browse files
Files changed (1) hide show
  1. viewer.js +3 -2
viewer.js CHANGED
@@ -115,8 +115,9 @@ export async function initializeViewer(config, instanceId) {
115
 
116
  const opts = new pc.AppOptions();
117
  opts.graphicsDevice = device;
118
- opts.mouse = new pc.Mouse(canvas);
119
- opts.touch = new pc.TouchDevice(canvas);
 
120
  opts.componentSystems = [
121
  pc.RenderComponentSystem,
122
  pc.CameraComponentSystem,
 
115
 
116
  const opts = new pc.AppOptions();
117
  opts.graphicsDevice = device;
118
+ // Attach input to document.body (not canvas) for iOS, to match PlayCanvas example and fix iOS event issues
119
+ opts.mouse = new pc.Mouse(document.body);
120
+ opts.touch = new pc.TouchDevice(document.body);
121
  opts.componentSystems = [
122
  pc.RenderComponentSystem,
123
  pc.CameraComponentSystem,