Skip to content

Commit

Permalink
Fixed FilePicker button issue on mobiles (stopped consuming <label> t…
Browse files Browse the repository at this point in the history
…ouch events)
  • Loading branch information
salmonb committed Sep 1, 2023
1 parent df62873 commit 8ef9573
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,10 @@ protected static boolean passHtmlTouchEventOnToFx(TouchEvent e, String type, jav
!requestPdrExit /* primaryButtonDown must be false for a pdr exit, true otherwise */, false, false, false, false, false, null);
((Scene) fxTarget).impl_processMouseEvent(mouseEvent);
// We return true (even if not consumed) to always prevent browsers built-in touch scrolling, unless if the
// target is a standard html tag that reacts to touch elements, such as <a> or <input> (ex: slider)
if (e.target instanceof HTMLAnchorElement || e.target instanceof HTMLInputElement)
// target is a standard html tag that reacts to touch elements, such as:
if (e.target instanceof HTMLAnchorElement // <a> clickable link
|| e.target instanceof HTMLInputElement // <input> (ex: slider)
|| e.target instanceof HTMLLabelElement) // <label> that may embed an <input> such as WebFX Extras FilePicker button
return false;
return true;
}
Expand Down

0 comments on commit 8ef9573

Please sign in to comment.