Skip to content

Commit

Permalink
fix: added style to component used for text measurement on Android (#…
Browse files Browse the repository at this point in the history
…3858)

Co-authored-by: Gabriel Jean <[email protected]>
  • Loading branch information
Y0lk and Gabriel Jean authored Aug 2, 2023
1 parent d60685b commit 9cb6442
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/components/FAB/AnimatedFAB.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
ScrollView,
StyleProp,
StyleSheet,
Text,
View,
ViewStyle,
} from 'react-native';
Expand Down Expand Up @@ -499,7 +498,20 @@ const AnimatedFAB = ({
// proper text measurements there is a need to additionaly render that text, but
// wrapped in absolutely positioned `ScrollView` which height is 0.
<ScrollView style={styles.textPlaceholderContainer}>
<Text onTextLayout={onTextLayout}>{label}</Text>
<AnimatedText
variant="labelLarge"
numberOfLines={1}
onTextLayout={onTextLayout}
ellipsizeMode={'tail'}
style={[
styles.label,
uppercase && styles.uppercaseLabel,
textStyle,
]}
theme={theme}
>
{label}
</AnimatedText>
</ScrollView>
)}
</Surface>
Expand Down

0 comments on commit 9cb6442

Please sign in to comment.