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.

In TextTruncator, allow an option to apply the "shave" only if the amount of text that will be hidden is substantial

See original GitHub issue

Observed behavior

In the implementation of TextTruncator, we always truncate the text if the text will exceed a certain max height prop.

In some cases, this leads to a situation where 75% of a paragraph is shown and the last 25% is hidden. It might have been better just to show the whole paragraph and spare the user from clicking a button to see the rest.

Example: (3 lines shown, 1 line hidden)

Screen Shot 2020-01-17 at 2 37 13 PM Screen Shot 2020-01-17 at 2 37 18 PM

Expected behavior

For certain situations, do not trim the text esp. if the untrimmed text is not that much bigger.

User-facing consequences

Errors and logs

Steps to reproduce

Context

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jonboisercommented, Mar 23, 2021

Oh, that’s interesting. I didn’t notice that was done in that commit.

The showViewMore in RecommendedPage/ContentCardGroupHeader is not used as a prop in TextTruncator (they just have the same name by coincidence).

I need to look into this, but I think if https://github.com/learningequality/kolibri/commit/a1f37830fd1d55043867b3338a357fa05c604ced#diff-98afdf62d41fff77bd66c302cf23e1bcf8aa203c53049d27b81699e9db5a622fL57 removed TextTruncator from the topics pages, then that actually resolves the problem that prompted me to write this issue.

I think I should just close this issue for now, unless you have a good idea on how to implement this new feature.

If you are interested, this issue https://github.com/learningequality/kolibri/issues/7557 is much more important and affects the majority of places where we use TextTruncator without the showViewMore prop.

1reaction
jonboisercommented, Mar 23, 2021

@Kalovelo , yes, any help on this issue would be appreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Caregiving: Shaving an Adult - My Health Alberta
If you need to do the shaving, ask if the person wants to be shaved in a certain way, such as starting with...
Read more >
Shaving (for Teens) - Nemours KidsHealth
Follow these shaving tips for guys and get a quick, easy, and painless shave. ... At worst, a dull blade will remove a...
Read more >
How to Send Hidden Messages on iPhone (easy) - YouTube
It show you how to find hidden messages on your iPhone as well as how to send secret texts. Hope you enjoy. Shot...
Read more >
Gillette one ups Dollar Shave Club with on-demand razor ...
The new service will be named “Gillette on Demand,” and it will allow customers to either text for a shipment on demand or...
Read more >
A Woman's Guide to Shaving with a Safety Razor
Luckily, Rockwell Razors let you adjust the level of blade exposure so you can start off with a super mild setting, and shave...
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