Skip to content

Commit 9cb6442

Browse files
Y0lkGabriel Jean
andauthored
fix: added style to component used for text measurement on Android (#3858)
Co-authored-by: Gabriel Jean <gab@inkrebit.com>
1 parent d60685b commit 9cb6442

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/FAB/AnimatedFAB.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
ScrollView,
1515
StyleProp,
1616
StyleSheet,
17-
Text,
1817
View,
1918
ViewStyle,
2019
} from 'react-native';
@@ -499,7 +498,20 @@ const AnimatedFAB = ({
499498
// proper text measurements there is a need to additionaly render that text, but
500499
// wrapped in absolutely positioned `ScrollView` which height is 0.
501500
<ScrollView style={styles.textPlaceholderContainer}>
502-
<Text onTextLayout={onTextLayout}>{label}</Text>
501+
<AnimatedText
502+
variant="labelLarge"
503+
numberOfLines={1}
504+
onTextLayout={onTextLayout}
505+
ellipsizeMode={'tail'}
506+
style={[
507+
styles.label,
508+
uppercase && styles.uppercaseLabel,
509+
textStyle,
510+
]}
511+
theme={theme}
512+
>
513+
{label}
514+
</AnimatedText>
503515
</ScrollView>
504516
)}
505517
</Surface>

0 commit comments

Comments
 (0)