ionic-team / ionic-team/ionic-framework
bug: toast, cannot render only button and have container fit width
- Lingua principale
- TypeScript
- Stelle
- 52.7k
- Fork
- 13.3k
- Merge medio
- 1g 15h
- PR unite (30g)
- 51
Descrizione
### 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_
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.