ionic-team / ionic-team/ionic-framework

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

オープン
#25,657 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
package: core type: bug
主要言語
TypeScript
スター
52.7k
フォーク
13.3k
平均マージ
1日 15時間
マージ済み PR(30日)
51

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。