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
{{ message }}
Repository navigation
www.facebook.com - The 'Guests can invite friends' checkbox cannot be checked after it has been unchecked #6214
URL: www.facebook.com Browser / Version: Firefox Mobile Nightly 55.0a1 (2017-04-25) Operating System: Samsung Galaxy Note 4 (Android 5.0.1) Problem type: Mobile site is not usable
changed the title [-]www.facebook.com - mobile site is not usable[/-][+]www.facebook.com - The 'Guests can invite friends' checkbox cannot be checked after it has been unchecked[/+]on Apr 26, 2017
softvision-sergiulogigan commented on Apr 26, 2017
The problem lies in how they handle touch events in this case.
When I tell their script that hasTouchEvents() is false (that is, there is no ontouchstart in window), or equivalently prevent their touchstart handler from being attached, then things work just fine.
However, when hasTouchEvents() is true, the following block of code is called to set up some touch event handlers on the HTML element:
var m = c("MTouchableSyntheticClickGK").USE_SYNTHETIC_CLICK,
n = "touchable",
o = 3,
p = 160,
q, r, s, t, u, v;
function w(event) { // touchstart handler
__p && __p();
if (r) D(false);
r = event.getNode(n);
if (r.getAttribute("disabled") !== null) {
event.prevent();
r = null;
return
}
var F = event.getRawEvent().targetTouches[0];
s = F.target;
B();
q = [l.listen("touchmove", n, x), l.listen("touchend", n, y), l.listen("touchcancel", n, z)];
t = {
x: F.screenX,
y: F.screenY
};
u = h(function() {
r && D(true)
}, p)
}
function x(event) { // touchmove handler
if (r && E(event)) {
D(false);
A()
}
}
function y(event) { // touchend handler
__p && __p();
if (r) {
var F = !v;
D(true);
// if (m && !j.get(r).nativeClick && s.getAttribute("target") != "_blank") k.click(s, event);
C(F)
} else {
k.killGhostClicksNearTouch();
C()
}
}
function A(F) {
clearTimeout(u);
r && h(D.bind(null, false, r), F ? p : 0);
v = false;
s = r = t = null
}
function B() {
if (q) {
q.forEach(function(F) {
F.remove()
});
q = []
}
}
function C(F) {
A(F);
B()
}
function D(F, G) {
if (!G) v = F;
i.conditionClass(G || r, "touched", F)
}
function E(event) {
var F = event.getRawEvent().targetTouches[0],
G = event.getNode("moving-box") || document.documentElement.scrollWidth > window.innerWidth;
return Math.abs(t.y - F.screenY) >= o || G && Math.abs(t.x - F.screenX) >= o
}
if (k.hasTouchEvents()) l.listen("touchstart", n, w)
Note that line I commented out in the touchend handler y. It calls K.click(), which creates a "click" MouseEvent and fires it on the input. Why? I don't know, as there will be a click event naturally fired on the input after all the touch events, since the normal sequence of events on a tap is: touchstart, touchmove, touchend, mouseover, mousemove, mousedown, mouseup, click.
As such, they synthesize a click, then the normal one happens, and they cancel each other out. Per standards, it's a site error.
I'm not sure why they feel the need to synthesize a click when one is already due, so they can perhaps just change their USE_SYNTHETIC_CLICK variable to false, which works. Otherwise they really should call preventDefault on the subsequent click event. That may be tricky to track, so they can alternatively just preventDefault on the touchend event, if they don't mind the browser not firing the rest of the events after touchend (all the mouse ones and click), which also works.
Activity
[-]www.facebook.com - mobile site is not usable[/-][+]www.facebook.com - The 'Guests can invite friends' checkbox cannot be checked after it has been unchecked[/+]softvision-sergiulogigan commentedon Apr 26, 2017
The issue is also reproducible when selecting friends to add to a new group.
MDTsai commentedon Apr 27, 2017
Confirmed, also reproducible on Firefox desktop in responsive mode. Move to needsdiagnosis
softvision-sergiulogigan commentedon Dec 20, 2017
The issue is still reproducible.
Tested on Huawei P10 (Android 7.0), Firefox Nightly 59 and Chrome 63.
wisniewskit commentedon Jan 23, 2018
The problem lies in how they handle touch events in this case.
When I tell their script that
hasTouchEvents()isfalse(that is, there is noontouchstart in window), or equivalently prevent theirtouchstarthandler from being attached, then things work just fine.However, when
hasTouchEvents()is true, the following block of code is called to set up some touch event handlers on the HTML element:Note that line I commented out in the
touchendhandlery. It callsK.click(), which creates a "click" MouseEvent and fires it on the input. Why? I don't know, as there will be a click event naturally fired on the input after all the touch events, since the normal sequence of events on a tap is: touchstart, touchmove, touchend, mouseover, mousemove, mousedown, mouseup, click.As such, they synthesize a click, then the normal one happens, and they cancel each other out. Per standards, it's a site error.
I'm not sure why they feel the need to synthesize a click when one is already due, so they can perhaps just change their
USE_SYNTHETIC_CLICKvariable tofalse, which works. Otherwise they really should callpreventDefaulton the subsequentclickevent. That may be tricky to track, so they can alternatively justpreventDefaulton thetouchendevent, if they don't mind the browser not firing the rest of the events aftertouchend(all themouseones andclick), which also works.adamopenweb commentedon Apr 6, 2018
Contacted via partner mailing list.
adamopenweb commentedon Apr 6, 2018
They have passed this bug to the Mobile Web team.
adamopenweb commentedon Jul 18, 2018
Pinging them today to see about an update.
adamopenweb commentedon Oct 31, 2018
This has been fixed by Facebook. Thanks everyone!
lock commentedon Nov 7, 2018
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue at https://webcompat.com/issues/new if you are experiencing a similar problem.