From 45d8d355744cba347b8bb433c6c2800b874b3d48 Mon Sep 17 00:00:00 2001 From: fawaz-ahmed Date: Tue, 8 Feb 2022 04:26:43 +0500 Subject: [PATCH] fix empty line, short text issue for ios --- example/src/ReadMore.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example/src/ReadMore.js b/example/src/ReadMore.js index 5d3abb6..40f77af 100644 --- a/example/src/ReadMore.js +++ b/example/src/ReadMore.js @@ -228,7 +228,7 @@ const ReadMore = ({ _lineOfImpact.index = numberOfLines - 1; if (Platform.OS === 'ios') { const modifiedIndex = lines.findIndex((_line, index) => { - if (index < numberOfLines - 1) { + if (index < numberOfLines - 1 || !_line.text?.trimEnd?.()) { return false; } return collapsedLines[numberOfLines - 1].text.includes(_line.text); diff --git a/package.json b/package.json index 70d96d7..6a13fed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fawazahmed/react-native-read-more", - "version": "2.3.0", + "version": "2.3.1", "description": "A simple react native library to show large blocks of text in a condensed manner with the ability to collapse and expand.", "main": "index.js", "types": "index.d.ts",