We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5020076 commit 4f9e674Copy full SHA for 4f9e674
1 file changed
projects/angular-split/src/lib/utils.ts
@@ -10,7 +10,10 @@ export interface ClientPoint {
10
* Only supporting a single {@link TouchEvent} point
11
*/
12
export function getPointFromEvent(event: MouseEvent | TouchEvent | KeyboardEvent): ClientPoint {
13
- if (event instanceof TouchEvent) {
+ // NOTE: In firefox TouchEvent is only defined for touch capable devices
14
+ const isTouchEvent = (e: typeof event): e is TouchEvent => window.TouchEvent && event instanceof TouchEvent
15
+
16
+ if (isTouchEvent(event)) {
17
if (event.changedTouches.length === 0) {
18
return undefined
19
}
0 commit comments