ionic-team / ionic-team/ionic-framework

bug: toast, cannot render only button and have container fit width

Đang mở
#25,657 7 bình luận 0 reaction 0 người được giao Xem trên GitHub
package: core 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 include this feature request, without success.

### Describe the Feature Request

i really like the Toast Component, but in 99% of my apps i ending up implementing my own toast's, which has mostly two reasons:

- Swipeable feature (there exists a PR for that since a long time: #23124)
- Click handler on the toast itself - not a specific button

The second one is the one i want to target in here 😊

### Describe the Use Case

It would be great beeing able to add a click handler to the whole toast. Two things i would use this for:

- "Undo" toast after an action
- In most apps i fetch push notifications when you are in app and present them via a toast - like instagram does.

For both cases the click handler would help a lot, as an extra button is not very nice here.

### Describe Preferred Solution

This should work similar to the handler of e.g. an alert button: Called on click and you **can** return a `boolean | Promise` that says if you should dismiss or don't dismiss the toast

### Describe Alternatives

_No response_

### Related Code

_No response_

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