一个仅影响左撇子用户的错误
A bug which affected only left handed users

原始链接: https://shkspr.mobi/blog/2026/07/a-bug-which-only-affected-left-handed-users/

作者发现其WordPress博客存在一个恼人的漏洞:用户在滚动页面时,“回复”链接会意外触发。经调查,作者意识到该问题仅影响左撇子用户,因为他们的拇指正好位于链接上方。 问题的根本原因是WordPress源代码在2017年添加的一个不必要的`touchstart`监听器。从历史角度看,这段代码旨在绕过浏览器曾用于区分点击和双击缩放手势的300毫秒延迟。然而,由于现代浏览器多年前已解决了这一延迟问题,这段代码不仅毫无用处,反而导致左撇子访客产生令人沮丧的误触操作。 作者没有等待WordPress的官方补丁,而是通过删除这些冗余代码解决了该问题。尽管作者打趣道,目前还没有什么HTML标签能将网站限制为“仅供右撇子使用”,但这一修复成功防止了网站为左撇子读者触发不必要的评论框弹出。

```Hacker News最新 | 往期 | 评论 | 提问 | 展示 | 招聘 | 提交登录一个只影响左撇子用户的 Bug (shkspr.mobi)7 分,sixhobbits 发布于 1 小时前 | 隐藏 | 往期 | 收藏 | 2 条评论 帮助 sixhobbits 11 分钟前 | 下一条 [–] 在领英(LinkedIn)移动端上确实有类似的事情让我非常困扰。我是左撇子,浏览动态时经常会误点赞,因为点赞按钮离我滚动屏幕时的自然触碰位置太近了。回复 loloquwowndueo 4 分钟前 | 父评论 | 下一条 [–] 解决办法很简单:别用领英 :) 我只在找工作的时候才用它,而且从来不看“动态”(那玩意儿到底是干嘛用的?)回复 指导方针 | 常见问题 | 列表 | API | 安全 | 法律 | 申请加入 YC | 联系 搜索: ```
相关文章

原文

Verily, some of our brethren (and sistren) be afflicted with a sinister disposition. While the righteous scroll using the thumb of their right hand - as is good and proper - an accurs'd minority swing the other way.

Look, you try writing an interesting bug report without sounding like a clanker, OK!

I try to optimise my blog as much as possible. It may not look like much, but it has got it where it counts. I've made a lot of special modifications myself to the base WordPress install.

One of those modifications is reducing the amount of JavaScript in use to the bare minimum. Everything functions without it, but there are a few places where it helps - the most notable being comments.

That's why I was distressed when a loyal reader wrote in saying there was a bug on my site. When they were scrolling the page a comment box would suddenly appear and interrupt their browsing.

I scroll my own site a lot (probably more than is healthy) so why hadn't I noticed this bug?

Because I scroll with my right thumb and the bug reporter uses their left. The "reply" link which was being triggered is on the left side of the page. A bug which won't be triggered by righteous people but infuriating to those who will surely be left behind after The Rapture™.

To be fair, this bug was reported seven years ago - but I guess the WordPress team have been too busy cleaning up after their mad God-Emperor to take a look at it.

Back in 2017, a developer added a touchstart listener to link clicks. I don't really understand why. At one point in history, browsers couldn't be sure if a touch event was the start of a click or a double-tap to zoom. So firing an even when a touch occurred on a link sort of made sense to avoid a 300ms delay.

But that hadn't been the case for several years - as this 2013 blog post makes clear. Even in 2015 it was no longer an issue.

So why was this lefty-baiting code added? Not a clue.

Anyway, seven years after the bug was reported I committed a fix. It isn't the most sophisticated change to WordPress - merely deleting a couple of lines. But hopefully it will stop those strange and unusual mutants from complaining that their unnatural thumb-usage is accidentally triggering unwanted events on my website.

Sadly, there is as yet no way to prevent the corrupt from using our blessed sites. The WHAT-WG haven't seen fit to take on board my suggestion of <meta handed="right"> to keep out the unwanted and polluted. So, hopefully, this change will at least prevent them complaining.

Why, yes officer, I have had a glass or two of tonic wine. Why do you ask?

联系我们 contact @ memedata.com