
My Favorite Side Project Was Broken in Safari for Years and Nobody Noticed
This is a tough one to write, because it involves me making a mistake. A mistake that persisted in prod for probably three years.
以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。
Oct 15, 2026 •
things-i-learned
•
browsers,
safari
This is a tough one to write, because it involves me making a mistake. A mistake that persisted in prod for probably three years.
Let’s go back to 2023. I used this popular app with my friends to figure out what day we wanted to have game night. It was fine, but then it added a bunch of ads, and forced people to log in, and basically started to suck.
So I built Noodle. “How hard could it be?” (It was relatively simple, the hardest part was getting an email provider that allowed transactional emails only, and was free. AWS actually told me my use case wasn’t allowed. Hah.) Now Noodle is used all over the world - just today it seems to be being used by someone in a German hospital. Fascinating!
I have an Android phone, and I don’t use Safari on my work laptop. And I just….never tested it in Safari.
Until last month, when someone on a Slack I lurk on was asking about scheduling apps that were accessible. I actually worked quite hard (with the help of my sister) to make Noodle accessible, to the point of vendoring the date picker library I used, which didn’t have keyboard controls or proper ARIA roles, and modifying it so that it did.
And the person said: “When I click the forward button on the calendar to go forward a month, nothing happens.”
And I said (to myself), “You’re obviously doing it wrong.”
I said out loud, “I can’t replicate that.”
So I asked about her device and browser. IPhone.
Sinking feeling in my chest, I texted another friend who I knew was an iPhone user. “Could you tell me if the calendar buttons on this site work?”
And then I tried the app on desktop Safari.
To fast-forward a bit, I traced the problem to a bit of code I wrote to handle events on the forward<->backward buttons on the calendar. I’m not sure what I was thinking at the time, but I had this code:
if(document.activeElement.classList.contains('rmdp-arrow-container')) { //switch months }
Turns out that browsers handle activeElement differently. Despite being listed as “baseline” by MDN, the behavior in Safari is wildly out of sync with what Chrome and Firefox do:
On Safari, following the behavior of macOS, elements that aren’t text input elements are not focusable by default, unless the “Full Keyboard Access” setting is enabled in System Settings.
That means that clicking a button (yes, a real button, not a div with a click listener) does not set the .activeElement in Safari, which means that the conditional is never true, which means the calendar doesn’t change months. Oof.
I’m torn between feeling bad that I didn’t think to test this browser behavior in Safari, and wondering why none of my iPhone-having-friends brought this up before.
The fix was to just transition to looking at e.target.classList.value, so thankfully a one-liner, and all the keyboard controls still work.
A win for Noodle, and a good lesson for me: ALWAYS TEST. “Baseline” doesn’t mean “the same.”
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。