Here’s the piece of code causing the bug (from app/assets/javascripts/discourse/app/lib/click-track.js)
// Cancel click if triggered as part of selection.
const selection = window.getSelection();
if (selection.type === "Range" || selection.rangeCount > 0) {
if (selectedText() !== "") {
return true;
}
}
Removing this code solves the problem and doesn’t appear to break tests (I have some tests failing before and after the change for some reason but no new ones apparently).
So I’m wondering whether this code does anything useful because one thing it sure doesn’t do is what it says it does, otherwise the bug reporter would experience no link follow at all upon ‘select + click’ but that’s not his complaint.
Can someone share what this code is supposed to accomplish?