Skip to content

Commit

Permalink
Merge pull request #28785 from BhuvaneshPatil/27703-align-checkboxes
Browse files Browse the repository at this point in the history
fix: align checkbox with input levels
  • Loading branch information
deetergp authored Oct 6, 2023
2 parents 98f3b43 + 0397cfc commit 0ce103d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function Checkbox(props) {
onPress={firePressHandlerOnClick}
onMouseDown={props.onMouseDown}
ref={props.forwardedRef}
style={[props.style, StyleUtils.getCheckboxPressableStyle(props.containerBorderRadius + 2)]} // to align outline on focus, border-radius of pressable should be 2px more than Checkbox
style={[StyleUtils.getCheckboxPressableStyle(props.containerBorderRadius + 2), props.style]} // to align outline on focus, border-radius of pressable should be 2px more than Checkbox
onKeyDown={handleSpaceKey}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.CHECKBOX}
accessibilityState={{checked: props.isChecked}}
Expand Down
1 change: 1 addition & 0 deletions src/components/CheckboxWithLabel.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function CheckboxWithLabel(props) {
isChecked={isChecked}
onPress={toggleCheckbox}
label={props.label}
style={[styles.checkboxWithLabelCheckboxStyle]}
hasError={Boolean(props.errorText)}
forwardedRef={props.forwardedRef}
accessibilityLabel={props.accessibilityLabel || props.label}
Expand Down
4 changes: 4 additions & 0 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -3718,6 +3718,10 @@ const styles = (theme) => ({
receiptDropHeaderGap: {
backgroundColor: theme.receiptDropUIBG,
},

checkboxWithLabelCheckboxStyle: {
marginLeft: -2,
},
});

// For now we need to export the styles function that takes the theme as an argument
Expand Down

0 comments on commit 0ce103d

Please sign in to comment.