-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the issue
Long text in a fixed size height shown cut, cant declare numberOfLines because the text length and the height are different in different cases.
Expected behavior
the expected resolute (works well in mobile)
we want the text to cut where it is fully shown even if it is smaller than the specified height
Steps to reproduce
example:
import React from 'react';
import {Text} from 'react-native';
const Test = ({maxHeight}) => {
return (<Text ellipsizeMode={'tail'} style={{maxHeight, borderWidth: 2, borderColor: 'blue', textOverflow: 'ellipsis', overflow: 'hidden'}}>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 2 2 2 22 2 22 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 33 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 33 3 3 33 3 3 3 3 33 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 55 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 </Text>)
};
export default Test;
React Native: Version 0.71.19
browser: Google Chrome Version 129.0.6668.101 (Official Build) (arm64)
Simulator: IOS 17.5
Test case
Additional comments
No response
a-eid