---
title: "Managing Focus Transitions in Slack"
description: "Slack built FocusTransitionManager, a React Context-based coordinator that lets sender components request focus moves via transitionFocusTo({focusKey}) and receiver components claim them via shouldTransitionFocus, so keyboard and screen-reader users don't lose focus when React re-renders remove the focused element."
url: "https://swe.quest/articles/managing-focus-transitions-in-slack-0a96821594858656"
canonical: "https://slack.engineering/managing-focus-transitions-in-slack/"
source: "Slack Engineering"
published: "2021-07-13"
difficulty: "medium"
kind: "Case study"
reading_minutes: 7
tags: ["accessibility","react","frontend","design-systems"]
---

# Managing Focus Transitions in Slack

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2021-07-13, 7 min read, Case study. Original: [https://slack.engineering/managing-focus-transitions-in-slack/](https://slack.engineering/managing-focus-transitions-in-slack/)

## Summary

Slack built FocusTransitionManager, a React Context-based coordinator that lets sender components request focus moves via transitionFocusTo({focusKey}) and receiver components claim them via shouldTransitionFocus, so keyboard and screen-reader users don't lose focus when React re-renders remove the focused element. Extensions include focusMetadata for targeting specific items, forceFocus for non-keyboard users, an additionalCondition callback to defer focus until data loads, timeouts to reset stale requests, and first-request-wins handling of concurrent requests. It was adopted across 100+ user flows within months, wired into the routing layer to focus the likely next action in each view, and built into Modal so all menus, popovers and modals restore focus reliably.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)
- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Design systems](https://swe.quest/tags/design-systems.md) (Web & mobile)

## Prerequisites

- React Context API ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- React refs ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- DOM focus management ([easy posts on Engineering management](https://swe.quest/tags/engineering-management.md?difficulty=easy))

## Keywords

FocusTransitionManager, React Context API, Slack, screen readers

## Related posts

- [Building Custom Animations in the Workflow Builder](https://swe.quest/articles/building-custom-animations-in-the-workflow-builder-94f541be651a6e1e.md): Slack Engineering · 2023-12-05 · Medium · 7 min read · React, Frontend, Product engineering
  Slack's Workflow Builder added drag-and-drop from a new steps sidebar into workflows by moving react-beautiful-dnd's DragDropContext to wrap the whole builder page, with two draggable/droppable lists.
- [Building accessibility into a canvas-based product](https://swe.quest/articles/building-accessibility-into-a-canvas-based-product-b9de69277feff18d.md): Figma · 2026-07-01 · Medium · 9 min read · Accessibility, Frontend, Browsers, React
  Because Figma renders its canvas itself rather than through HTML, the browser's accessibility tree is nearly empty, so Figma rebuilt accessibility with a hidden but laid-out "Mirror DOM" synced to the scenegraph.
- [A conversation with Figma's accessibility team](https://swe.quest/articles/a-conversation-with-figma-s-accessibility-team-4d7c0aee064f1f20.md): Figma · 2022-11-17 · Easy · 9 min read · Accessibility, Frontend
  Figma's accessibility engineers and PM reflect on shipping screen reader support for prototypes and a FigJam beta.
- [Fluid layout customization with Splits](https://swe.quest/articles/fluid-layout-customization-with-splits-32c6c1613a8a91da.md): Replit · 2022-09-28 · Medium · 9 min read · Frontend, React, Data structures, Product engineering
  Replit's Workspace now supports Splits, a tiling layout where tabs, panes and files from the filetree can be dragged onto five hit areas of any pane (header to merge, or four conical-section quadrants to split), plus maximize and float modes.
- [Building a more accessible GitHub CLI](https://swe.quest/articles/building-a-more-accessible-github-cli-b16ba0e7481d923f.md): GitHub Engineering · 2025-05-02 · Easy · 6 min read · Accessibility, Developer tools
  GitHub CLI's Public Preview (v2.72.0, enabled via \`gh a11y\`) adapts accessibility practice to the terminal, where no WCAG-equivalent standard exists and screen readers must infer structure from a plain character grid.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
