Skip to content

Commit

Permalink
Added user touch interaction detection (required for sound on iOS/iPa…
Browse files Browse the repository at this point in the history
…dOS)
  • Loading branch information
salmonb committed May 28, 2024
1 parent d49ad97 commit db62b22
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,14 @@ private static void registerTouchListener(EventTarget htmlTarget, String type, j
AddEventListenerOptions passiveOption = AddEventListenerOptions.create();
passiveOption.setPassive(false); // May be set to true in some cases to improve Lighthouse score
htmlTarget.addEventListener(type, e -> {
UserInteraction.setUserInteracting(true);
boolean fxConsumed = passHtmlTouchEventOnToFx((TouchEvent) e, type, fxTarget);
if (fxConsumed) {
e.stopPropagation();
if (!UserInteraction.nextUserRunnableRequiresTouchEventDefault())
e.preventDefault();
}
UserInteraction.setUserInteracting(false);
}, passiveOption);
}

Expand Down

0 comments on commit db62b22

Please sign in to comment.