-
Notifications
You must be signed in to change notification settings - Fork 735
add ellipsizeMode prop for text truncation and improve accessibility #3542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@adids1221 The ticket in the additional info is not correct, can you fix it? 🙏 |
fixed. |
src/components/avatar/index.tsx
Outdated
@@ -185,6 +187,7 @@ const Avatar = forwardRef<any, AvatarProps>((props: AvatarProps, ref: React.Forw | |||
useAutoColors, | |||
autoColorsConfig, | |||
containerStyle, | |||
ellipsizeMode = 'clip', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the prop name should be more informative on where it goes. Perhaps is better:
ellipsizeMode = 'clip', | |
labelEllipsizeMode = 'clip', |
src/components/avatar/index.tsx
Outdated
@@ -354,7 +357,7 @@ const Avatar = forwardRef<any, AvatarProps>((props: AvatarProps, ref: React.Forw | |||
> | |||
<View testID={`${testID}.container`} style={textContainerStyle}> | |||
{!_.isUndefined(text) && ( | |||
<Text numberOfLines={1} style={textStyle} testID={`${testID}.label`}> | |||
<Text numberOfLines={1} ellipsizeMode={ellipsizeMode} style={textStyle} testID={`${testID}.label`}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Text numberOfLines={1} ellipsizeMode={ellipsizeMode} style={textStyle} testID={`${testID}.label`}> | |
<Text numberOfLines={1} ellipsizeMode={labelEllipsizeMode} style={textStyle} testID={`${testID}.label`}> |
…wix/react-native-ui-lib into feat/Avatar_label_ellipsizeMode_support
Checked on Private with snapshot |
Description
Avatar add
ellipsizeMode
prop for text truncation and improve accessibility handeling.When using larger text on the device the label grow outside the container in some cases, we decided to remove the default
ellipsizeMode
and set it toclip
.Changelog
Avatar add
ellipsizeMode
prop for text truncation and improve accessibility handeling.Additional info
MADS-4654