Commit b0e60f6
authored
fix: attaching
## 📜 Description
Fixed a problem of non working `onMove` handler in development builds.
## 💡 Motivation and Context
In
#1184
I started to rely that `didBecomeActive` event will be caught and we can
attach the view from this listener. But turns out that in dev builds we
miss this event. So at the moment:
- view hierarchy may be not ready by time of creating
`KeyboardTrackingView` (noticeable in release versions);
- after `didBecomeActive` hierarchy is ready (but we may miss this event
if we subscribed later, and also we rely on sequence of Apple events and
it's kind of transitive dependencies that may break at any point of
time).
So I decided to re-work the approach. We attach `KeyboardControllerView`
anyway, so I thought it's good to add a side effect in `didMoveToWindow`
and attach our `KeyboardTrackingView`. For that I added optional param
to `attachToTopmostView` method (called `toWindow/window`). If we pass
the window then we use that param, otherwise rely on `activeWindow` and
take `rootViewController.view`.
Such combination seems to solve all these issues when `onMove` stops
working under certain conditions. Now we always pass a window reference
for a first mount and don't rely on internal Apple timing and events.
Closes
#1191
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### E2E
- sync assets with working `onMove` handler on iOS 26;
### iOS
- make `KeyboardTrackingView` public;
- pass `toWindow/window` into `attachToTopmostView` method;
- pass `window` into `attachToTopmostView` from `didMoveToWindow`
lifecycle.
## 🤔 How Has This Been Tested?
Tested:
- iPhone 16 Pro, iOS 26 (XCode 16, physical device) - repro app
(release/debug + cold start); ✅
- iPhone 16 Pro, iOS 26 (XCode 16, simulator) - example app
(release/debug + cold start) + Modal in separate window example; ✅
- iPhone 16 Pro, iOS 26 (XCode 26, simulator) - example app
(release/debug + cold start) + Modal in separate window example; ✅
## 📸 Screenshots (if appropriate):
|Before (debug)|After (debug)|Release repro|
|-------|----|--------------|
|<video
src="https://github.com/user-attachments/assets/9af9992c-462c-45fc-8d2e-51d2fbe66dd9">|<video
src="https://github.com/user-attachments/assets/7dcabd42-7310-4251-9870-29ba7c073517">|<video
src="https://github.com/user-attachments/assets/68bd986f-7c1e-414f-a492-9178d72d5b8a">|
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changedKeyboardTrackingView (#1193)1 parent 2bfe0c9 commit b0e60f6
9 files changed
Lines changed: 20 additions & 11 deletions
File tree
- e2e/kit/assets/ios/iPhone 17 Pro
- ios
- observers/movement
- observer
- views
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 59 | | |
66 | 60 | | |
67 | | - | |
| 61 | + | |
68 | 62 | | |
69 | 63 | | |
70 | 64 | | |
71 | 65 | | |
72 | 66 | | |
73 | 67 | | |
74 | | - | |
75 | | - | |
| 68 | + | |
| 69 | + | |
76 | 70 | | |
77 | 71 | | |
78 | 72 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
262 | 270 | | |
263 | 271 | | |
264 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| |||
0 commit comments