wix / wix/react-native-navigation

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

Open
#6,344 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

platform: iOS type: accepted/bug
Dominant language
MDX
Stars
13.2k
Forks
2.6k
Avg merge
6d 2h
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the modal presentation path exercised by playground ModalScreen.js and the modalPresentationStyle: 'popover' option. Reproduce the crash on iOS using the supplied example, then trace how the popover presentation is configured. Done means opening this modal no longer raises the UIPopoverPresentationController exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.