ionic-team / ionic-team/ionic-framework
bug: toast, icon-only buttons can get squished horizontally
- 主要言語
- TypeScript
- スター
- 52.7k
- フォーク
- 13.3k
- 平均マージ
- 1日 14時間
- マージ済み PR(30日)
- 50
説明
### 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).
コントリビューションガイド
調査の方向性
Ionic の toast コンポーネントから始め、リンクされた StackBlitz の例を使って、複数のボタンと狭いコンテナを含むレイアウトを再現します。toast ボタンのスタイル、特にアイコンのみのボタンを確認し、そのアイコンの幅が安定して維持され、ボタンのテキストがオーバーフローしないことを検証します。小さい画面でアイコンボタンが楕円形になったり消えたりしなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- css, typescript
- 領域
- frontend
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100