ionic-team / ionic-team/ionic-framework

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

Đang mở
#25,878 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
package: react type: bug
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.