Merge pull request #8981 from benediktwerner/fix-analysis-contextmenu

Fix analysis context menu on browsers without TouchEvent support
pull/8983/head
Niklas Fiekas 2021-05-20 11:31:40 +02:00 committed by GitHub
commit 46d4a7d01a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ const elementId = 'analyse-cm';
function getPosition(e: MouseEvent | TouchEvent): Coords | null {
let pos = e as PageOrClientPos;
if (e instanceof TouchEvent && e.touches.length > 0) pos = e.touches[0];
if ('touches' in e && e.touches.length > 0) pos = e.touches[0];
if (pos.pageX || pos.pageY)
return {
x: pos.pageX!,