ionic-team / ionic-team/ionic-framework

bug: dismiss callback from useIonModal is not called after first dismiss

Đang mở
#28,964 4 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

v7.x

### Current Behavior

When the `canDismiss` callback returns `false` the overlay layer is dismissed and the user can interact again with the modal. If the user tries to close it again the `canDismiss` callback callback is no longer called.

Screenshot 2024-02-02 at 17 27 57

Screenshot 2024-02-02 at 17 23 00

The Modal is opened in this way:

` present({ canDismiss: canDismiss})`

### Expected Behavior

If the user does not wish to close the modal, canDismiss must return false. But the user should be allowed to close the modal at a later time.

### Steps to Reproduce

1. Open an IonModal using the hook `useIonModal`
2. Provide a canDismiss function which returns `resolve(false)` if the user doesn't want to close the modal
4. Close the modal using the `dimiss`function
5. Refuse to close the modal and the overlay layer will disappear
6. Call the `dismiss` again
7. Nothing happens

### Code Reproduction URL

_No response_

### Ionic Info

I have an error running it linked to the macOS:
TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

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