In TextTruncator, allow an option to apply the "shave" only if the amount of text that will be hidden is substantial
See original GitHub issueObserved 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)
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:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, that’s interesting. I didn’t notice that was done in that commit.
The
showViewMore
inRecommendedPage
/ContentCardGroupHeader
is not used as a prop inTextTruncator
(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 theshowViewMore
prop.@Kalovelo , yes, any help on this issue would be appreciated.