The Accessibility Engineer audits and fixes web UIs for WCAG 2.2 conformance. It covers semantic HTML, ARIA roles and properties, keyboard navigation patterns, focus management, color contrast, and screen reader behavior - including the edge cases where automated tools give passing scores but real assistive technology still fails. All patterns are validated against NVDA + Firefox and VoiceOver + Safari.
WCAG 2.2 Success Criteria - Most Commonly Failed
| Criterion | Level | Failure | Fix |
|---|---|---|---|
| 1.1.1 Non-text content | A | Missing or generic alt text on images | alt="Product: Blue Running Shoe" - describe function, not appearance |
| 1.3.1 Info and relationships | A | Visual headings styled with CSS, not semantic <h2> | Use heading elements; heading level = document outline level |
| 1.4.3 Contrast (Minimum) | AA | Text contrast ratio below 4.5:1 (3:1 for large text) | Test with browser DevTools or contrast checker; fix palette tokens |
| 2.1.1 Keyboard | A | Custom widgets not keyboard operable | Add keyboard handlers; follow ARIA APG patterns |
| 2.4.3 Focus order | A | Focus jumps to unexpected element after modal opens | Move focus to modal heading on open; return focus to trigger on close |
| 2.4.11 Focus appearance | AA | Default browser focus ring removed with outline: none | Use :focus-visible; provide 2px outline with 3:1 contrast ratio |
| 4.1.3 Status messages | AA | Toast or alert rendered without live region | Add role="status" or aria-live="polite" to the container |
Modal Dialog Pattern
// Accessible modal: focus trap + ESC to close + aria attributes
function Modal({ isOpen, onClose, title, children }) {
const modalRef = useRef(null);
const previousFocusRef = useRef(null);
useEffect(() => {
if (isOpen) {
previousFocusRef.current = document.activeElement;
// Move focus to the first focusable element in the modal
modalRef.current?.querySelector('[autofocus], h2, button')?.focus();
} else {
// Return focus to the element that opened the modal
previousFocusRef.current?.focus();
}
}, [isOpen]);
useEffect(() => {
const handleKeyDown = (e) => {
if (e.key === 'Escape') onClose();
};
if (isOpen) document.addEventListener('keydown', handleKeyDown);
return () => document.removeEventListener('keydown', handleKeyDown);
}, [isOpen, onClose]);
if (!isOpen) return null;
return (
<div role="dialog" aria-modal="true" aria-labelledby="modal-title" ref={modalRef}>
<h2 id="modal-title">{title}</h2>
{children}
<button onClick={onClose}>Close</button>
</div>
);
}
ARIA Live Regions
// Announce dynamic content to screen readers without moving focus
// For non-urgent status updates (form saved, item added to cart)
<div role="status" aria-live="polite" aria-atomic="true">
{statusMessage}
</div>
// For urgent alerts (error, session expiry warning)
<div role="alert" aria-live="assertive" aria-atomic="true">
{alertMessage}
</div>
// Rules for live regions:
// 1. The live region container must exist in the DOM before content is injected
// 2. aria-atomic="true" announces the entire region, not just the changed text
// 3. Never put live regions inside modals - they won't announce reliably
// 4. One live region for status, one for alerts - don't create many
Custom Interactive Widget Checklist
Before shipping any custom widget (dropdown, combobox, date picker, tabs):
- Find the pattern in the ARIA Authoring Practices Guide - follow it exactly
- Every interactive element is reachable via Tab
- Arrow keys navigate inside a widget (listbox, menu, tablist) - Tab moves to the next widget
- Enter/Space activate the focused item
- ESC closes popups and returns focus to the trigger
aria-expanded,aria-selected,aria-checkedreflect current state- Test with keyboard only - no mouse at all
- Test with NVDA + Firefox and VoiceOver + Safari - automated tools miss 30–40% of real failures