fix: long message content overflowing issue in overlay #2244
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.
🎯 Goal
This PR fixes two UX issues:
🛠 Implementation details
Issue 1
There are two types of message overlay. One where we show message actions and another one where we show reactions from all the users. The overflowing content can only be resolved by adding ScrollView on message overlay. At some point we decided to remove
ScrollView
because we already have aFlatList
in OverlayReactions component (as shown in 2nd screenshot below). FlatList inside ScrollView results into red warning from RNSolution
messageTextNumberOfLines
prop.Screen.Recording.2023-09-28.at.16.47.33.mov
Issue 2
First issue is about
messageTextNumberOfLines
not working as expected. The reason being, this prop was added to every paragraph's Text node, which would result in each paragraph being truncated to given number of lines.Solution
There is no perfect solution for this at the moment. But we can improve this, by adding this prop only to the first paragraph. But keep in mind that this would also mean that if first paragraph only contains 2 lines and
messageTextNumberOfLines
is set to 3 - we will show the first paragraph completely and hide rest of the paragraphs without any truncation suffix (...
). But I think its a worthy tradeoff.🎨 UI Changes
iOS
Android
🧪 Testing
☑️ Checklist
develop
branch