dotdotdot-js icon indicating copy to clipboard operation
dotdotdot-js copied to clipboard

Dotdotdot brakes grid display

Open MrTimber opened this issue 2 years ago • 0 comments

I have some Bootstrap cards on a wrapper with class .cards-grid using grid display:

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

Then I limit the height of the text on the card body:

.card.card-body .card-text.dot-dot-dot {
    max-height: 120px;
    overflow: hidden;
}

And I use Dotdotdot on it to add the ellipsis (I use jQuery, but you can do the same in pure Javascript):

$(function() {
    $(".dot-dot-dot").each(function () {
      new Dotdotdot(this);
    });
});

Dotdotdot works to add the ellipsis but it brakes the grid display.

I get this with Dotdotdot: image

Instead of this without Dotdotdot: image

MrTimber avatar Jul 15 '21 09:07 MrTimber