Skip to content

bug(toast): icon is misaligned when message spans multiple lines on stacked layout #30908

@DwieDima

Description

@DwieDima

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

When using ion-toast with an icon and a long message that wraps onto multiple lines, the icon is rendered at the top of the toast instead of being vertically centered inline with the text.

  • With short messages, the icon appears correctly inline with the text
  • With long messages (wrapping to multiple lines), the icon is positioned at the top of the toast container instead of aligning with the text block
Image

Expected Behavior

The icon should remain inline and vertically centered relative to the message text, regardless of message length

Steps to Reproduce

  1. go to stackblitz
  2. click on any button
  3. see result
  4. shorten message text to single line
  5. see result

Code Reproduction URL

https://stackblitz.com/edit/s2onkm9n?file=src%2Fapp%2Fexample.component.ts

Ionic Info

see stackblitz

Additional Information

As a workaround i override the icon shadow part:

ion-toast::part(icon) {
  display: flex;
  align-self: baseline;
  margin-top: 15px;
  margin-left: 15px;
}
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions