ionic-team / ionic-team/ionic-framework

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

Abierto
#25,657 7 comentarios 0 reacciones 0 asignados Ver en GitHub
package: core type: bug
Lenguaje dominante
TypeScript
Estrellas
52.7k
Forks
13.3k
Merge medio
1 d 15 h
PR fusionados (30 d)
51

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.