You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across an issue on https://www.sleeper.scot/ that is happening in Firefox on mobile device. When trying to select an option in one of the dropdowns the selection popup dissapears:
Note that this is only happening when a page is scrolled.
The problem seems to be with mouseEventSimulated not detecting the simulated mouse event in Firefox. It all starts from the following condition:
When the page is scrolled, Both pageX and pageY properties exist in the event in Firefox, and also when the page is scrolled pageY is not 0, so the logic inside the above function never gets executed.
Apparently it causes some issues later on with x an y properties of lastTouch, so mouseEventSimulated returns undefined
I'm not sure why if (!e.pageX && !e.pageY) { is being used, but thinking replacing it with: if (origEvent.type === 'touchend') would make sense, since lastTouch is being set only for the touchend event. I've tried that and it fixes the issue for me.
Would appreciate you thoughts on that. If that sounds like a reasonable idea I can make a PR with a fix.
The text was updated successfully, but these errors were encountered:
I came across an issue on https://www.sleeper.scot/ that is happening in Firefox on mobile device. When trying to select an option in one of the dropdowns the selection popup dissapears:
Here is a reduced test case: https://codepen.io/anon/pen/dBzmbm
Note that this is only happening when a page is scrolled.
The problem seems to be with
mouseEventSimulated
not detecting the simulated mouse event in Firefox. It all starts from the following condition:jcf/js/jcf.js
Lines 166 to 170 in d002e9f
When the page is scrolled, Both
pageX
andpageY
properties exist in the event in Firefox, and also when the page is scrolledpageY
is not 0, so the logic inside the above function never gets executed.Apparently it causes some issues later on with x an y properties of
lastTouch
, somouseEventSimulated
returns undefinedAs a result the first condition resolves in
false
, causing dispatching of mouse events and I think that what's closing a closure of the popup:I'm not sure why
if (!e.pageX && !e.pageY) {
is being used, but thinking replacing it with:if (origEvent.type === 'touchend')
would make sense, sincelastTouch
is being set only for the touchend event. I've tried that and it fixes the issue for me.Would appreciate you thoughts on that. If that sounds like a reasonable idea I can make a PR with a fix.
The text was updated successfully, but these errors were encountered: