Is this a WCAG design fail?


Last week I posted about why the accept attribute on file inputs is bad UX.

The accept attribute lets you specify which file types an input will accept. For example, if users need to upload a receipt, you can do this:

<input type="file" accept="image/jpeg,image/png,application/pdf">

That means users can only select those file types. All other files are disabled:

This sounds good because it stops users from picking an invalid type before they submit - which would then cause an error.

But as I said in the post, this is bad UX because:

  1. The disabled files are greyed out making them hard to read
  2. Some users will not notice the subtle greyed out styling - so will try clicking the invalid files anyway

For them, this makes the interface feel broken and confusing.

But someone called Russell replied to me in disagreement:

Disabling non-eligible options is good UX, recommended by WCAG (Web Content Accessibility Guidelines).
Users may have to go through the upload flow several times and not understand why it’s not working.
You’re also breaking Jakob’s Law — disabling files when uploading is something users are familiar with.
Ignoring it forces them to adjust their approach, increasing friction and cognitive load.

The problem is that the accept attribute causes the exact problem we’re both trying to solve.

Specifically, that users won’t understand why the interface isn’t working.

And this isn’t theoretical.

I’ve seen this repeatedly in user research.

Russell did also say that we should tell users the accepted types in hint text:

This way users know what to do before they open the file dialog.

Totally agree.

But you can’t rely on every user reading hint text. Research repeatedly shows that many users don’t spot or read it.

And when this happens users end up rage clicking because they don’t understand why the computer isn’t responding.

That’s bad.

Even if the user does read the hint text, there’s no guarantee they’ll remember what it says - perhaps they:

  • are stressed and in a rush
  • get interrupted by a phone call
  • have cognitive impairments or memory issues

So the accept attribute is not a layer of protection.

It’s the cause of the problem.

If instead we ditch the accept attribute and show an error, users get feedback that helps them fix the problem, right there and then like this:

If that’s not enough to convince you - and it should be - there are three more issues with the accept attribute:

  1. It only handles file type, not file size
  2. You can bypass it by dragging and dropping files instead
  3. Some browsers don’t support it - for example, Firefox on Android

So not only is it fragile, you still have to handle errors anyway.

I asked Russell to cite where WCAG recommends the accept attribute. He sent me advisory guidance relating to criterion 3.3.2:

Choose a design that reduces the chance that the user will make a mistake. This includes: […] Using an interface where only valid input can be selected.

To be clear:

This is not success criteria. It’s advisory guidance.

But this guidance almost definitely comes from Jakob Nielsen’s 5th usability heuristic about error prevention.

The heuristic is fine, but designers constantly misinterpret it as approval to hide errors from users.

As if it’s better to hide an error and pretend one doesn’t exist, than it is to show the error and let users fix it.

In short:

Error hiding is not error prevention.

Which is why the accept attribute is so bad.

If you’d like to know all the different, legitimate, user-friendly ways to properly prevent errors - instead of hiding them, you might like my course, Form Design Mastery:

https://formdesignmastery.com

Cheers,
Adam

Design tips to help you create products that are ridiculously simple and accessible to use

Join 10,000+ designers, content designers and engineers who get my free weekly newsletter with evidence-based design tips (in 3 minutes or less). Mostly forms UX, but not always.

Read more from Design tips to help you create products that are ridiculously simple and accessible to use
Me holding a sign saying "Test boring patterns first."

Last week, someone paid me to review their form flow. One thing they wanted advice about was interruption pages. Coincidentally, the following day the GOV.UK Design System added the interruption page pattern. Interruption pages are designed to pause the user within a journey - usually to warn them about a possible mistake or give them important information before they continue. Here’s an example from the GOV.UK Design System: It has: An h1 heading to ask a simple question A paragraph to...

Me holding a sign saying, "We all have fuzzy edges."

Last week, Kate Ivey-Williams, the Head of UCD on my programme, asked me: “What do you think your role is as a designer?” I said: “Errr... I design products that are easy to use... errr... I realise that’s a rubbish answer...” Kate saved me: “Don’t worry, I put you on the spot” But even so, as a designer you should be ready to be put on the spot because: If you aren’t able to explain what you do, it’s much harder for your teammates and stakeholders to value what you do. I messaged Kate later...

Me holding a sign that says, "Good UX is holistic."

Last week, I ran a live training on file upload UX. Every day leading up to the event, I was stressed, constantly thinking: “Shall I just purchase one month of Zoom?” Let me explain: I use Circle to run my courses and it comes with something called Live Rooms. It’s like Zoom. But Live Rooms is better than Zoom because: it’s quicker and easier to set up for me it comes with my Circle subscription for free it automatically posts the recording afterward the call it has better UX for my students...