Skip to content

Commit

Permalink
#864 - gave 95% space to text to avoid it getting cut. for single sel…
Browse files Browse the repository at this point in the history
…ectable item, fixed auto select as per new selectable item callback.
  • Loading branch information
petmongrels committed Feb 10, 2023
1 parent 4ffda5a commit f387040
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class SelectableItem extends React.Component {
<Pressable onPress={onPress}
style={({pressed}) => [{backgroundColor: pressed ? 'red' : 'white'}, renderStyle.container]} disabled={disabled}>
<Icon.Button iconStyle={{marginLeft: -10}} name={iconName} backgroundColor="white" color={iconColor} onPress={onPress} disabled={disabled}>
<Text style={[Styles.formBodyText, {color: textColor, fontSize: 16}, extraLineHeight]}>
<Text style={[Styles.formBodyText, {color: textColor, fontSize: 16, flex: 0.95}, extraLineHeight]}>
{displayText}
</Text>
</Icon.Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SelectableItemGroup extends React.Component {
<View style={{flexDirection: "row", display: "flex"}} key={idx}>
{rlvPair.map((radioLabelValue) => {
const checked = selectionFn(radioLabelValue.value);
return <View style={{flex: 0.5, display: "flex", paddingHorizontal: 10}}
return <View style={{flex: 0.5, display: "flex", paddingHorizontal: 2}}
key={radioLabelValue.label}>
<SelectableItem displayText={I18n.t(radioLabelValue.label)}
checked={checked}
Expand Down Expand Up @@ -95,7 +95,7 @@ class SelectableItemGroup extends React.Component {
renderSingleValue() {
const radioLabelValue = _.head(this.props.labelValuePairs);
if (!this.props.selectionFn(radioLabelValue.value)) {
this.props.onPress(radioLabelValue);
this.props.onPress(radioLabelValue.value, radioLabelValue.label);
}
return (
<Text style={Styles.formLabel}>{radioLabelValue.label}</Text>
Expand Down

0 comments on commit f387040

Please sign in to comment.