ionic-team / ionic-team/ionic-framework
bug: Cannot set Nav root component in modal with willPresent event
- Langage dominant
- TypeScript
- Étoiles
- 52.7k
- Forks
- 13.3k
- Merge moyen
- 1 j 15 h
- PR mergées (30 j)
- 51
Description
### 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_
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.