Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the text overflow on RecipeCard #1830

Merged
merged 2 commits into from
Nov 27, 2022

Conversation

dorj222
Copy link
Contributor

@dorj222 dorj222 commented Nov 15, 2022

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

This PR fixes the recipe description text overflow issue when the text length is longer than 500 characters. If the description text is longer than 350 characters, only the first 350 characters will be shown on a card view.

New Card View with the long description:

Screen Shot 2022-11-15 at 4 42 24 PM

Which issue(s) this PR fixes:

#1829

(REQUIRED)

Release Notes

(REQUIRED)

 the recipe description text overflow issue on a card view has been fixed

@michael-genson
Copy link
Collaborator

I was curious if this issue persisted on the condensed (mobile) view, and it looks like it's solved for using CSS:

.headerClass {
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

Then I checked out why the normal card didn't do this, but then I noticed that it does, just only for the name. Can you try implementing this with a CSS class similar to the mobile view?

Something like this:

<v-card-text class="v-card--text-show white--text">
  <div class="headerClass">
    {{ description }}
  </div>
</v-card-text>

But probably with a new class to show more than a single line

@dorj222
Copy link
Contributor Author

dorj222 commented Nov 22, 2022

Hello, thank you so much for your feedback! I added a wrapper class that utilizes the WebKit-line-clamp property, and now at most first 8 lines of the description will be displayed, and the remaining overflow text will be hidden.

The screenshot example:
Screen Shot 2022-11-22 at 4 25 15 PM

@hay-kot hay-kot merged commit ac6554e into mealie-recipes:mealie-next Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants