ionic-team / ionic-team/ionic-framework
bug: toast, icon-only buttons can get squished horizontally
- Vorherrschende Sprache
- TypeScript
- Sterne
- 52.7k
- Forks
- 13.3k
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 51
Beschreibung
### 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
v6.x
### Current Behavior
The element `.toast-button-icon-only` is squeezed on smaller screens with multiple buttons.
We could prevent this by adding `flex-shrink: 0` to the button elements to keep the icon size.
In my case I display the `::part(container)` in `flex: column` and `word-wrap: break-word` because the space on the right side is too small. The problem is, that I cannot select children of shadow parts. So I cannot select the icon button and cannot set flex-shrink to the container in this case.
### Expected Behavior
The icon size should keep size regardless of the parent size. Don't squeezed the circle to an oval (width) what cause the icon to shrink.
### Steps to Reproduce
Create a toast with some custom buttons. The first button with text. The second button just with icon only "close" and cancel role like the default button. Select part container and set flex-direction column. And word-wrap: break-word. But I doubt that my customizations affects that.
### Code Reproduction URL
https://stackblitz.com/edit/ionic6-angular13-ga1wv5?file=src%2Fapp%2Fapp.component.ts
### Ionic Info
Ionic 6 (ionic info not working in my monorepo)
### Additional Information
| Current | Shrink 0 |
| --- | --- |
|||
| The icon is squeezed and size changed. It shrinks. In some case until it's completly invisible. | The icon size is stable. |
Another demo with some fixes in button and text wrap:

I know, in this record the screen size is really small what you never have in real life. But this is just for demo reason. In my app I test with min width of 320px. But anyway...
Maybe another issue but the buttons or its text should wrap. As you see that they overflow out of screen.
https://ionicframework.com/docs/v6/api/toast
See [demo](https://stackblitz.com/edit/ionic6-angular13-ga1wv5?file=src%2Fapp%2Fapp.component.ts).
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.