Skip to content

Conversation

@kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Oct 15, 2025

To Do

  • check slow animations
  • check instant transition (i. e. emoji picker) (division by 0 in isFinished?)
  • iOS 18 + prefer cross fade produces a jump when keyboard hides <- fixed by stateful animations

📜 Description

Manually dispatch end events on iOS.

💡 Motivation and Context

With iOS 26 introduction Apple changed many internals. One critical change for keyboard-controller is timing of events. The timing was really stable across iOS 12-16. But starting from 17 we get issues like #327 which we fixed in a different ways, but the last and the most stable fix was made in #557

However with new changes relying on did events on iOS is not reliable anymore 😔 I've been analyzing many options, but the most reliable in my understanding is dispatching those events myself. Since we have an access to the animation and the beginning of the event, we can easily dispatch our own event when animation finishes.

So in this PR I'm doing exactly that - we don't rely on OS events anymore and dispatch our own events. It looks ridiculous, because we are literally fixing OS bugs, but it is as it is.

At the moment iOS 26 dispatches keyboardDidShow after ~40ms if cross-fade + reduced motion enabled. In first OS versions they always dispatched keyboardDidShow straight after keyboardWillShow (which produced missing animation, but they fixed it before a global launch, I think).

Closes #1242 #1141

📢 Changelog

JS

  • update teanimated/workelts to avoid strange errors;
  • mock react-native-worklet;

iOS

🤔 How Has This Been Tested?

Tested locally on:

  • iPhone 16 Pro (iOS 26.2, simulator)
  • iPhone 16 Pro (iOS 18.5, simulator)
  • e2e tests;

📸 Screenshots (if appropriate):

Issue 1141

Before (iOS 26.2) After (iOS 26.2) After (iOS 18.5)

Issues 1242

Before (iOS 26.2) After (iOS 26.2) After (iOS 18.5)
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-01-14.at.12.58.13.mov
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-14.at.12.45.20.mov

Issue 327 (works as before)

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-01-14.at.10.04.31.mov

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Oct 15, 2025
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working  iOS 26 Anything specific to iOS 26 labels Oct 15, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 15, 2025

📊 Package size report

Current size Target Size Difference
230450 bytes 230191 bytes 259 bytes 📈

@kirillzyusko kirillzyusko force-pushed the feat/manual-did-events branch from cfe6ffc to f6d8877 Compare January 13, 2026 11:01
…we may dispatch `end` event after animation finish + 1 frame. If cross-fade transitions enabled on iOS 18.5, the `opacity` animation will gone, and we'll read keyboard frame and it'll produce a jump when keyboard hides. Tracking if animation has been finished allows us to skip those undesired frames and in future they may help to improve performance if we start to use Newton Rhapson method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working  iOS 26 Anything specific to iOS 26

Projects

None yet

2 participants