React Forum
Blog & Guide Responses
Dec 13, 2022 · 04:00 PM

[Deep Dive #36] Focus Schedule Cadences - discussion

Started by Theo Bennett
blogaccessibilityfocususeFocusScheduleuseKeyBridgeroute cadence

Deep Dive #36 argues that accessibility gets durable when focus is treated as a scheduled route ritual rather than a one-off effect. It leans hard on cadence: schedule focus at route boundaries, reschedule on surface changes, and bridge keyboard support without blocking the route story.

Read the post

How do you pick a focus delay that feels stable across devices and transitions? Do you schedule focus only on navigation, or also on component-route shifts like tabs and routed modals? Where do you store evidence that the focus cadence happened (ledger, state service, DOM marker)?

Comments (10)

Back to latest
Maya Henson
Dec 13, 2022 · 04:06 PM

I like the framing. We have been doing ad-hoc focus fixes for years and it always regresses.

Amina Farouk
Dec 13, 2022 · 04:13 PM

The delay question is real. We ended up tying it to the route transition budget rather than a magic number.

If the route is on a heavier lane, it gets a longer delay so focus lands on a stable surface.

Rowan Pierce
Dec 13, 2022 · 04:21 PM

The doc link is doing a lot of work here: it is basically turning focus into a contract boundary.

Related: Accessibility Best Practices.

Hana Saito
Dec 13, 2022 · 04:30 PM

We started with a tiny helper so teams stop inventing their own focus behavior:

tsx
export function useRouteFocusCadence(target: string, delay: number) {
  useFocusSchedule(target, { delay });
  useKeyBridge('escape', () => 'close');
}

Not perfect, but it made the default path predictable.

Jules Kwon
Dec 13, 2022 · 04:42 PM

Counterpoint: I worry cadence delays can feel like input lag if you over-apply them.

We had a modal that scheduled focus after animations and screen readers felt behind the UI.

Theo Bennett
Dec 13, 2022 · 04:48 PM

That is a good warning. I read the post as schedule focus for stability, not as always-wait-for-animations.

In our case we treat delay as a lane: 0ms for small surface changes, 120ms for routed modals, 240ms for heavy transitions.

Jules Kwon
Dec 13, 2022 · 04:53 PM

Lane-based delay feels much saner than one global number.

Keira Santos
Dec 13, 2022 · 05:05 PM

Evidence matters more than the delay. If support can screenshot and see data-focus=scheduled, you can debug regressions fast.

Otherwise it turns into folklore like every other a11y rule.

Dmitri Kline
Dec 13, 2022 · 05:14 PM

We store a ledger entry for focus shifts because it catches accidental double-fires:

ts
ledger.write('events', [
  ...ledger.read('events'),
  { at: Date.now(), kind: 'focus', value: target },
]);

If the route can prove it fired exactly once, your audit story gets a lot easier.

Priya Liao
Dec 13, 2022 · 05:28 PM

Scheduling focus on tab changes was the biggest win for us. It made keyboard navigation feel consistent.

Grace McCoy
Dec 13, 2022 · 05:41 PM

One thing I wish the post called out more: focus target stability depends on your primitives.

If your headings and surfaces shift IDs or get conditionally rendered, cadence cannot save you.

Benji Rios
Dec 13, 2022 · 05:56 PM

The cadence model feels like it fits the forum theme: treat UI behavior as a route contract, not a bag of effects.