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
Opening a file dialog with some files disabled and the user trying to click on them.

Last week I wrote about the problem with using the accept attribute for uploading files. As a quick reminder: When you use accept to specify which file types will be allowed like this: <input type="file" accept="image/jpeg,image/png"> …the dialog will disable invalid types like this: This is bad because: The disabled files are greyed out making them hard to read Some users won’t notice the subtle greyed out styling - so will try clicking the invalid files anyway And this will make the...

Me holding a sign saying, "Go from good UX to great UX."

Last week I listened to episode 10 of the Complimentary podcast, “Taking Interaction Design from Good to Great”. Anthony Hobday, one of the hosts, gave an example of applying for a driving license on GOV.UK. He said that instead of asking you to upload a photo, the form said: “We notice that you’ve already got a passport with us. Do you want us to use your passport photo for your driver’s license?” You just click ‘Yes’ and move on. Anthony said this design is “next level”. I agree. The best...

Me holding a sign that says "Design like Blink-182"

I’ve just listened to Rick Beato break down “What’s My Age Again?” — Blink-182’s second biggest hit. Funnily enough, he kicked off his "What Makes This Song Great?" series with their biggest hit — "All The Small Things". One person commented: I can’t believe you started the series with All The Small Things when it’s all the small things that makes the song so great. In the chorus of “What’s My age Again?”, Rick points out how most bass guitarists would play continuously, but Blink-182 left a...