Skip to content

bug: ion-item-divider end slot has no padding #23785

Closed

Description

@infacto

Prequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

The end slot is too close to the frame. It has no padding as the default slot.

image

Expected Behavior

The end slot should also have the same padding as the default slot. In other words: The ion-item-divider should have symmetric horizontal padding.

image

Steps to Reproduce

<ion-list class="ion-no-padding">
  <ion-item-divider>
    Items
    <span slot="end">0/4</span>
  </ion-item-divider>
</ion-list>

See CodePen

Code Reproduction URL

No response

Ionic Info

(It's a native Angular project without Ionic CLI. So info does not work.)
"@ionic/angular": "^5.6.7"

Additional Information

demo

<ion-item-divider>:
image

So just add the same padding on the right. Voila.

Workaround (global styles):

ion-item-divider {
  padding: 0 16px;
}

But this should handle the framework. Or is there a reason why there is no padding?

Another related issue: div.item-divider-inner should not use overflow: hidden. It affects the end-slot to be cropted if moved (e.g. with transform). Because the padding comes from the parent, this element has the width minus padding and cops the text moved a bit outside. We could overflow the host?

The structure of the elements is a bit weird. Slot "start" is outside of ".item-divider-inner" And end slot is part of inner. etc.

Activity

  1. liamdebeasi commented on Aug 18, 2021

    @liamdebeasi
    Contributor

    Thanks, I can reproduce this issue. Looks like the start and end padding values for the divider in iOS mode uses the same padding as ion-item, but the divider in MD mode only uses the padding for ion-item for the start padding.

  2. added
    package: core
    type: bug
    on Aug 18, 2021
  3. infacto commented on Aug 19, 2021

    @infacto
    Author

    I also wonder why this special layout? See source

    <slot name="start"></slot>
    <div class="item-divider-inner">
      <div class="item-divider-wrapper">
        <slot></slot>
      </div>
      <slot name="end"></slot>
    </div>
    • Slot "start" is outside the inner div.
    • Slot "end" and main slot is inside the inner div.
    • The main slot is wrapped again in a wrapper.
    • etc.

    Maybe requires a code redesign?

  4. mapsandapps commented on Mar 31, 2023

    @mapsandapps
    Contributor

    Thanks you for submitting this issue. It has been fixed in #27019, and a fix will be available in an upcoming release of Ionic Framework.

  5. ionitron-bot commented on Apr 30, 2023

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  6. locked and limited conversation to collaborators on Apr 30, 2023
  7. added a commit that references this issue on Jan 26, 2024
    426913d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions