Merged
Conversation
The detection if the read-more button is necessary happened once at render and wasn't recalculated after images loaded. This caused hidden message overflow without a read more button.
Using index is bad practice: https://react.dev/learn/rendering-lists#rules-of-keys We don't recalculate the overflow state once the message is overflown. When using the index as key, then when a new message is added at the top of the array at index 0. The overflow state from the previous message at index 0 is kept. The overflow state shouldn't be reused.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #848 +/- ##
=======================================
Coverage 78.77% 78.77%
=======================================
Files 56 56
Lines 2671 2671
=======================================
Hits 2104 2104
Misses 476 476
Partials 91 91 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To reproduce, create messages with varying height with and without images.
@eternal-flame-AD, could you give this a try?
Fixes #846