question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

headings in ion-labels don't inherit overflow and text-overflow

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior:

When nesting a heading (h1, h2, …) inside an ion-label, the overflow: hidden and text-overflow: ellipsis attributes don’t get inherited (anymore?).

Expected behavior:

The headings should inherit the proper overflow attributes.

Steps to reproduce/related code:

https://codepen.io/simonhaenisch/pen/JjPXPEq

<ion-list>
  <ion-item>
    <ion-label>
      <h2>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Architecto laborum, voluptatum corporis reprehenderit ipsa nostrum aperiam optio porro? Ipsa pariatur, earum sapiente nihil sed perspiciatis nostrum voluptas ipsum mollitia repellendus.</h2>
    </ion-label>
  </ion-item>
</ion-list>

Other information:

When setting text-wrap on the ion-label, the nested headings get wrapped as well, but setting text-nowrap still doesn’t apply text-overflow: ellipsis or overflow: hidden to the heading.

Ionic info:

@ionic/core@4.0.0-rc.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
brandyscarneycommented, Mar 3, 2020

@simonhaenisch I believe it would need to be this instead:

::slotted(*) h1,
::slotted(*) h2,
::slotted(*) h3,
::slotted(*) h4,
::slotted(*) h5,
::slotted(*) h6 {
  text-overflow: inherit;

  overflow: inherit;
}

but yes I would accept this.

Could you add a test in label/test/ called headings that is basically the same as your Codepen including the headings and paragraph? I can review and make changes. Thank you for offering to PR this!!

1reaction
simonhaenischcommented, Mar 9, 2020

@brandyscarney not sure you’ve seen it, I’ve opened a PR for it ☝️

Read more comments on GitHub >

github_iconTop Results From Across the Web

headings in ion-labels don't inherit overflow and text-overflow
When setting text-wrap on the ion-label , the nested headings get wrapped as well, but setting text-nowrap still doesn't apply text-overflow: ...
Read more >
Ion-item text not cutting a long line (text-overflow) properly in ...
Hello guys, i have a different result while developing and in production, when I use ionic serve everything looks ok, the text in...
Read more >
Ionic 4 bug: heading text-overflow in label - CodePen
Ionic 5. Labels have text-overflow set to "ellipsis", and paragrahs inherit that, but headings don't. Lorem, ipsum dolor sit amet consectetur adipisicing ...
Read more >
Ionic list item text overflow not adjusting the height of the list item
I've included the ionic class "item-text-wrap" at the list level (I've also tried at the item level with the same result) and it...
Read more >
ion-text-wrap, Ion-item (click event), ionic text-overflow ellipsis ...
x Current behavior: When nesting a heading (h1, h2, ) inside an ion-label, the overflow: hidden and text-overflow: ellipsis attributes don't get inherited...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found