gitwtfhub

wtf is transition-keyboard-demo?

virtuoztm/transition-keyboard-demo — explained in plain English

Analysis updated 2026-05-18

3TypeScriptAudience · developerComplexity · 2/5Setup · easy

TL;DR

A small Expo demo showing how to correctly time when the keyboard appears on an OTP screen so it does not fight the navigation animation.

Mindmap

mindmap
  root((Keyboard Demo))
    What it does
      Demonstrates focus timing
      Compares two patterns
      Delays keyboard appearance
    Tech stack
      Expo
      React Native
      Expo Router
    Use cases
      Fixing OTP screen jank
      Learning focus timing
      Reference implementation
    Audience
      Developers
      Mobile app builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

See a working example of delaying keyboard focus until a screen transition finishes

REASON 2

Compare a naive autoFocus implementation against a timing-aware one on an OTP screen

REASON 3

Reference real documentation links when fixing similar keyboard-timing bugs in a React Native app

What's in the stack?

ExpoReact NativeTypeScriptExpo Router

How it stacks up

virtuoztm/transition-keyboard-demo000madz000/payload-test-api-route-handlerakash-sr/memobsidian
Stars333
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min

Standard Expo project, run it to compare the clean focus approach against the autoFocus anti-pattern side by side.

Wtf does this do

This is a small demo app built with Expo, a toolkit for building mobile apps with React Native, that focuses on one specific and easy to get wrong detail: when should the on-screen keyboard pop up after you navigate to a one-time-code, or OTP, entry screen. The project shows the difference between a naive approach and a more careful one for handling this single moment in a mobile app. The problem it demonstrates is that if you tell the code entry field to grab keyboard focus the instant it is created, the keyboard can start sliding up while the screen itself is still sliding into view from the navigation transition, so the user sees two things moving on screen at the same time, which tends to feel janky, especially on Android phones. The fix shown here is to wait until the new screen is fully in view and settled, and only then bring up the keyboard, so the two animations happen one after another instead of on top of each other. The demo app has two screens you can navigate to from its home screen: one using the recommended, careful approach, and one deliberately using the naive shortcut, so you can compare how each one feels. The careful version preloads the keyboard controller before navigating, waits for the new screen to register as focused, waits two animation frames plus a short platform-specific pause, around 400 milliseconds on Android and 500 on iOS, and only then focuses the code input, cleaning up any pending timers if the user navigates away before that happens. The README backs up its recommendation with links to the official documentation for Expo Router, React Navigation, React Native's TextInput and animation APIs, and a keyboard-handling library called react-native-keyboard-controller, along with a real bug report describing this exact kind of timing problem happening to other developers. The project is built with Expo, Expo Router, HeroUI Native's InputOTP component, Uniwind, and react-native-keyboard-controller. The full README is longer than what was shown.

Yoink these prompts

Prompt 1
Explain why autoFocus on an OTP input causes janky animation during screen transitions
Prompt 2
Show me how this demo uses useFocusEffect and requestAnimationFrame to delay keyboard focus
Prompt 3
Help me adapt this delayed-focus pattern to my own React Native OTP screen
Prompt 4
Walk me through the platform-specific delay values used for Android versus iOS

Frequently asked questions

wtf is transition-keyboard-demo?

A small Expo demo showing how to correctly time when the keyboard appears on an OTP screen so it does not fight the navigation animation.

What language is transition-keyboard-demo written in?

Mainly TypeScript. The stack also includes Expo, React Native, TypeScript.

How hard is transition-keyboard-demo to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is transition-keyboard-demo for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.