Skip to content

Commit 7c3ed4b

Browse files
committed
Add iPad 13+ detection
1 parent 21acfce commit 7c3ed4b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

three.js/src/location-based/js/device-orientation-controls.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717

1818
import { Euler, EventDispatcher, MathUtils, Quaternion, Vector3 } from "three";
1919

20-
const isIOS = navigator.userAgent.match(/iPhone|iPad|iPod/i);
20+
const isIOS =
21+
navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
22+
(/Macintosh/i.test(navigator.userAgent) &&
23+
navigator.maxTouchPoints != null &&
24+
navigator.maxTouchPoints > 1); // for iPad Safari
2125

2226
const _zee = new Vector3(0, 0, 1);
2327
const _euler = new Euler();

0 commit comments

Comments
 (0)