Skip to content

Commit

Permalink
fix: Go to select token when clicking disabled input (#2876)
Browse files Browse the repository at this point in the history
Signed-off-by: Juliano Lazzarotto <[email protected]>
Co-authored-by: Juliano Lazzarotto <[email protected]>
  • Loading branch information
2 people authored and SorinC6 committed Nov 8, 2023
1 parent 1ad9c1f commit de04a93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const AmountCard = ({
{label != null && <Text style={[styles.label, !isEmptyString(error) && styles.labelError]}>{label}</Text>}

<View style={styles.content}>
<Pressable style={styles.amountWrapper} onPress={focusInput}>
<Pressable style={styles.amountWrapper} onPress={() => (noTokenSelected ? navigateTo?.() : focusInput())}>
<TextInput
keyboardType="numeric"
autoComplete="off"
Expand All @@ -77,13 +77,14 @@ export const AmountCard = ({
selectTextOnFocus
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
{...(noTokenSelected && {onPressIn: navigateTo})}
/>
</Pressable>

<Spacer width={7} />

<View style={styles.rightSection}>
<TouchableOpacity onPress={() => navigateTo?.()}>
<TouchableOpacity onPress={navigateTo}>
<View style={styles.sectionContainer}>
<Boundary loading={{fallback: <TokenIconPlaceholder />}} error={{fallback}}>
{noTokenSelected ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,14 @@ const swapFormReducer = (state: SwapFormState, action: SwapFormAction) => {
switch (action.type) {
case SwapFormActionType.SellTouched:
draft.sellQuantity.isTouched = true
draft.sellQuantity.displayValue = ''
draft.sellQuantity.error = undefined

break

case SwapFormActionType.BuyTouched:
draft.buyQuantity.isTouched = true
draft.buyQuantity.displayValue = ''
draft.buyQuantity.error = undefined

break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"start": {
"line": 129,
"column": 15,
"index": 4125
"index": 4188
},
"end": {
"line": 132,
"column": 3,
"index": 4208
"index": 4271
}
},
{
Expand All @@ -21,12 +21,12 @@
"start": {
"line": 133,
"column": 18,
"index": 4228
"index": 4291
},
"end": {
"line": 136,
"column": 3,
"index": 4317
"index": 4380
}
}
]

0 comments on commit de04a93

Please sign in to comment.