ionic-team / ionic-team/ionic-framework

bug: Cannot set Nav root component in modal with willPresent event

Offen
#25,878 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
package: react type: bug
Vorherrschende Sprache
TypeScript
Sterne
52.7k
Forks
13.3k
Ø Merge
1 T. 15 Std.
Gemergte PRs (30 T.)
51

Beschreibung

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

- [ ] v4.x
- [ ] v5.x
- [X] v6.x
- [ ] Nightly

### Current Behavior

When setting the root component of `IonNav` inside of a modal, developers are unable to set the root component in the `willPresent` event callback for the modal.

In both the Angular and Vue framework implementations this is possible.

### Expected Behavior

Developers should be able to set the root component in the `willPresent` event callback, to avoid having a flicker/delayed render of the root component.

### Steps to Reproduce

1. Render `IonNav` in `IonModal`
2. Bind go `willPresent` event of `IonModal`
3. In the event handler, set the root component of the `IonNav`: `nav.current.setRoot(PageOne)`
4. Present the modal
5. Observe: The root component is not set.

**Against reproduction app**
1. Click "Open modal"
2. Observe: Root component is not set in the modal

### Code Reproduction URL

https://stackblitz.com/edit/angular-vmakvy?file=src%2Fmain.tsx

### Ionic Info

N/A

### Additional Information

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.