ionic-team / ionic-team/ionic-framework

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

Abierto
#25,878 0 comentarios 0 reacciones 0 asignados Ver en GitHub
package: react type: bug
Lenguaje dominante
TypeScript
Estrellas
52.7k
Forks
13.3k
Merge medio
1 d 15 h
PR fusionados (30 d)
51

Descripción

### 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_

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.