Skip to content

Checkbox + RadioButton - fix long labels are stretching outside #2446

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

Merged
merged 2 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/checkbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ class Checkbox extends Component<CheckboxProps, CheckboxState> {
render() {
const {label, labelStyle, containerStyle, labelProps} = this.props;
return label ? (
<View row centerV style={[containerStyle]}>
<View row centerV style={containerStyle}>
{this.renderCheckbox()}
<Text style={[this.styles.checkboxLabel, labelStyle]} {...labelProps} onPress={this.onPress}>
<Text flexS style={[this.styles.checkboxLabel, labelStyle]} {...labelProps} onPress={this.onPress}>
{label}
</Text>
</View>
Expand Down
3 changes: 2 additions & 1 deletion src/components/radioButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ class RadioButton extends PureComponent<Props, RadioButtonState> {
const {opacityAnimationValue, scaleAnimationValue} = this.state;
const animationTime = 150;
const animationDelay = 60;

if (selected) {
Animated.parallel([
Animated.timing(opacityAnimationValue, {
Expand Down Expand Up @@ -229,7 +230,7 @@ class RadioButton extends PureComponent<Props, RadioButtonState> {
const {label, labelStyle, testID} = this.props;
return (
label && (
<Text marginL-10={!this.isContentOnLeft} marginR-10={this.isContentOnLeft} $textDefault style={labelStyle} testID={`${testID}.label`}>
<Text flexS marginL-10={!this.isContentOnLeft} marginR-10={this.isContentOnLeft} $textDefault style={labelStyle} testID={`${testID}.label`}>
{label}
</Text>
)
Expand Down