Building an Accessible Autocomplete Control

Adam Silver has published an in-depth write-up of his effort to build an autocomplete field that is as accessible as possible.

The component presents a long list of edge cases. Older browsers and their quirks have to be handled, screen-reader accessibility best practices must be followed, and the component's design has to work even when JavaScript is unavailable.

Silver opens with a caveat about the difficulty of the task:

[…] I've been looking at ways to let users enter a destination country. Unfortunately, native HTML form controls just aren't good enough for this type of interaction. And so we need to build a custom autocomplete control from scratch. A word of warning though: this is one of the hardest UI components I've ever had to make—they're just way harder than they look.

The piece is also noted as a reason to look forward to Silver's book, Form Design Patterns.