Skip to content

DiscountCard body text overflows in flex layout #515

@hossein-nas

Description

@hossein-nas

Summary
When using the DiscountCard web component, applying text-overflow: ellipsis to the body text does not work as expected — the text overflows instead of truncating. This happens because the body element inside the discount card uses flex layout with the default min-width: auto, preventing it from shrinking to fit the available space.

Steps to Reproduce

  1. Render a <DiscountCard> element.
  2. Put long text inside its body section.
  3. Apply CSS for ellipsis:
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  4. Observe that the text does not truncate.

Expected Behavior
Long text in the body section should be correctly truncated and display when the available width is insufficient.

Actual Behavior
Text overflows its container and breaks the intended layout.

Cause
Flex children with min-width: auto do not shrink smaller than their content's intrinsic size. This prevents truncation from working in flex layouts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions