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

Stop TextTruncator from briefly showing full text before shave.js truncates it #8101

Merged
merged 2 commits into from May 25, 2021

Conversation

jonboiser
Copy link
Contributor

@jonboiser jonboiser commented May 21, 2021

Summary

  1. Adds an inline style to the top-level div of TextTruncator that limits the height and hides the overflow of the untruncated text prop before shave.js can work on it. These styles are removed after shave.js has completed its work.
  2. Cancels the debounced updateTitle calls during the beforeDestroy hook so the code isn't executed later when the component is unmounted (creating a lot of logs in the console).

Screengrabs from TE - China

Before

CleanShot 2021-05-21 at 12 03 16

After

There is a slight change after shave.js works, but much more subtle than before

CleanShot 2021-05-21 at 11 34 32

References

Fixes #7982

Reviewer guidance

Find a channel where nodes have long descriptions like Touchable Earth or CK-12. You should be able to browse the Lesson Creation workflow without seeing the issues in #7982


Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

Copy link
Member

@nucleogenesis nucleogenesis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jonboiser jonboiser merged commit 85cbd75 into learningequality:develop May 25, 2021
@jonboiser jonboiser deleted the text-truncator-flashes branch May 25, 2021 16:41
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.

When TextTruncator in Lesson Resource cards unmounts, it flashes un-truncated text and has unhandled errors
2 participants