`showOverlay` creates a scene-less `UIWindow`, so overlays never appear under UIScene lifecycle
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- ios, react-native
- 领域
- mobile
调研方向
从 Navigation.showOverlay 和 RNNOverlayWindow 的原生实现入手,尤其是 initWithFrame: 路径,并将其与 setRoot 使用的现有 _mainWindow 处理进行比较。使用 UIWindowSceneDelegate 进行复现,并验证 overlay 窗口是否与宿主 UIWindowScene 关联。完成的标准是 showOverlay 显示在当前 root 之上,同时现有的 setRoot 行为保持不变。
由索引模型根据 Issue 内容生成。
描述
What happened?
On iOS, Navigation.showOverlay() creates a new RNNOverlayWindow with initWithFrame: and never assigns a UIWindowScene.
With a scene-based app lifecycle, that window is not added to the scene, so the overlay never appears. JS still mounts and runs (the overlay VC is created and rendered), which makes this look like a hang: native/RNN splash dismisses, overlay logic is running, but the screen stays on RNNSplashScreenViewController / the current root.
Navigation.setRoot() is not affected, because it attaches the layout to the existing _mainWindow that the host already bound to the scene.
This is easy to miss on older iOS if the app still used the AppDelegate window path. It becomes a hard break once the app adopts UIWindowScene (mandatory on iOS 26+).
What was the expected behaviour?
showOverlay shows the overlay above the current root on the same UIWindowScene.
Was it tested on latest react-native-navigation?
- I have tested this issue on the latest react-native-navigation release and it still reproduces.
Help us reproduce this issue!
- Use UIScene lifecycle (
UIApplicationSceneManifest+UIWindowSceneDelegate). - Create the window with
initWithWindowScene:and pass it to RNN (delegate.windowset before bootstrap). - On
Navigation.events().registerAppLaunchedListener, do notsetRoot. Call:
Navigation.showOverlay({
component: {
name: 'example.OverlayScreen',
},
});
- OverlayScreen mounts (
componentDidMount/useEffectruns) but nothing is visible. The scene window is stillRNNSplashScreenViewController.
Control: the same screen shown via setRoot appears correctly:
Navigation.setRoot({
root: {
stack: {
children: [{ component: { name: 'example.OverlayScreen' } }],
},
},
});
In what environment did this happen?
- react-native-navigation:
8.8.9 - react-native:
0.87(New Architecture / Fabric, bridgeless) - iOS: 26 / 27 (also repros conceptually on iOS 13+ with
UIScene) - Host:
RNNAppDelegate+ customUIWindowSceneDelegate - Platform: iOS only
- 主要语言
- MDX
- 星标
- 13.2k
- 派生
- 2.6k
- 平均合并
- 2 天 10 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wix/react-native-navigation 的其他 Issue
-
needs triage triage: documentation
难度 2/5 1-3 小时 新手友好度 68/100
wix/react-native-navigation#8343 · 1 条评论 ·
-
[Fix] searchBar `focus:` true ignored on mergeOptions when searchController already exists可能已有人在做 @IsaacIsrael 于 157 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
wix/react-native-navigation#8318 ·
-
needs triage type: accepted/bug
难度 4/5 3-5 天 新手友好度 25/100
wix/react-native-navigation#8365 · 2 条评论 ·
-
platform: iOS type: accepted/bug
难度 4/5 3-5 天 新手友好度 48/100
wix/react-native-navigation#8340 ·
-
platform: iOS type: accepted/bug
难度 4/5 3-5 天 新手友好度 48/100
wix/react-native-navigation#8339 ·
查看 wix/react-native-navigation 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
madeofpendletonwool/PinePods#1078 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
WalletConnect/walletconnect-monorepo#7389 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
-
难度 2/5 1-3 小时 新手友好度 86/100
daniel-pimenta-cc/ledor#58 ·
-
dependencies platform: ios
难度 1/5 1-3 小时 新手友好度 78/100
software-mansion/react-native-executorch#1617 ·
维护者通常 1 天内回复