[V6][iOS] modalPresentationStyle popover results in app crash - UIPopoverPresentationController should have a non-nil sourceView

未关闭
#6,344 11 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
ios, javascript, react-native
领域
mobile

调研方向

从 playground ModalScreen.js 和 modalPresentationStyle: 'popover' 选项所执行的模态呈现路径开始。使用提供的示例在 iOS 上重现崩溃,然后追踪 popover 呈现的配置方式。当打开此模态不再引发 UIPopoverPresentationController 异常时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

platform: iOS type: accepted/bug
Issue Description

When setting modalPresentationStyle to popover the application crashes when opening a modal.

xCode reports following:
*** Terminating app due to uncaught exception 'NSGenericException', reason: 'UIPopoverPresentationController (<UIPopoverPresentationController: 0x7f9dfa32d200>) should have a non-nil sourceView or barButtonItem set before the presentation occurs.'

Steps to Reproduce / Code Snippets / Screenshots

Following is directly from playground ModalScreen.js with the options modalPresentationStyle set to popover

  showModal = () => {
    Navigation.showModal({
      component: {
        name: Screens.Modal,
        passProps: {
          modalPosition: this.getModalPosition() + 1,
          previousModalIds: concat([], this.props.previousModalIds || [], this.props.componentId)
        },
        options: {
          modalPresentationStyle: 'popover'
        }
      }
    });
  }

Environment
  • React Native Navigation version: 6.7.5 & 6.8.0
  • React Native version: 0.62.2
  • Platform(s) (iOS, Android, or both?): iOS
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator 13.3 / Device 13.3
主要语言
MDX
星标
13.2k
派生
2.6k
平均合并
2 天 10 小时
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wix/react-native-navigation 的其他 Issue

查看 wix/react-native-navigation 的全部 Issue

相似的 Issue

更多 Mobile Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。