Fixed Reaction issue on Android

The Colonel

New member
Affected version
2.3.4
So the forum I volunteer as a mod on has had some reports of funky behavior. I am not the owner so if this is the wrong section; apologies in advance.

Reaction selection is exhibiting odd behavior for end users. When you hit the like button to select the desired reaction for longer than a micro-second; it brings up the right-click context menu instead of allowing you to pick the reaction you want. This is on mobile only. See screenshot below. Not a problem on IOS.

1737215982772.webp
 
Maybe dup:

On Android, this happens with any link, not just with the reaction link.
 
Honestly, it popped up recently. It got reported here within the last few days. It never used to do that, for what it's worth. Maybe something that can get addressed on the phone OS itself. Thanks for the reply.
 
This was reported almost a year ago.

 
This issue occurred to me when I upgraded to 2.3.x yesterday.

The fix is to edit your default style's react template to include
Code:
oncontextmenu="return false"

Without fix:
Code:
<xf:reaction id="{$reaction}"
    content="{$content}" link="{$link}" params="{$params}" list="{$list}" class="{$class}"
    init="true" hasreaction="{$hasReaction}" small="true" showtitle="true"  />

With fix:
Code:
<xf:reaction id="{$reaction}"
    content="{$content}" link="{$link}" params="{$params}" list="{$list}" class="{$class}"
    init="true" hasreaction="{$hasReaction}" small="true" showtitle="true" oncontextmenu="return false" />

If you have themes that aren't inheriting from the default style, you'll have to apply this on every top-level style.
 
IMG_9360.webp

Better, but still some weirdness with how text gets selected when you hold. Sometimes on the “Like” text as well. Maybe some CSS is in order?

CSS:
user-select: none;
 
Many years ago, that was omitted deliberately because while it caused the nearest element to the tap hold to no longer become selected, iOS would then find the next nearest element and start selecting that instead, and ultimately that became weirder than the current behaviour.

I'm sure WebKit has fixed that after all of this time... right?
 
Hah who knows… what if some JS was added that adds user-select: none; to the entire HTML element on click and removes it on release of that click? 🤷🏻‍♂️
 
Many years ago, that was omitted deliberately because while it caused the nearest element to the tap hold to no longer become selected, iOS would then find the next nearest element and start selecting that instead, and ultimately that became weirder than the current behaviour.

I'm sure WebKit has fixed that after all of this time... right?
So I actually tested it, and this does appear to make it work as expected:

CSS:
.message-footer {
  -webkit-user-select: none;
  user-select: none;
}

IMG_9362.webp

SO much better.

Safari does need the -webkit prefix, but seems to be working as expected... so maybe WebKit did fix whatever the issue was.
 
Actually, looks like there might still be some issues there unfortunately :( It still seems to select the parent container and so forth in our testing. There might be some other tricks we can apply here though (like applying it more broadly for the touchhold duration as you say). We'll have to play around with it.
 
Actually, looks like there might still be some issues there unfortunately :( It still seems to select the parent container and so forth in our testing. There might be some other tricks we can apply here though (like applying it more broadly for the touchhold duration as you say). We'll have to play around with it.
Maybe you just have fat fingers? hah j/k... I obviously didn't test it exhaustively, it was more a 10 second thing to inject the CSS to the message footer and click it a couple times. Was working for me, but also was one browser, one device and a couple clicks is all.
 
Back
Top Bottom