Skip to content

Commit

Permalink
[Wallet] Fix decimals keyboard in some Samsung devices (#5926)
Browse files Browse the repository at this point in the history
### Description

On some Samsung devices, the numpad when inputting decimal amounts was not showing the decimal separator (dot or comma).

This is because these Samsung devices apparently have the same value for the decimal pad constant than for the autocapitalize constant, which causes them to override each other (🤦 ).

### Tested

On a Samsung device:

Before:
![Screenshot_2020-11-20-13-31-32](https://user-images.githubusercontent.com/6062888/99824926-217c7e00-2b35-11eb-859c-79fefd2c9346.png)

After:
![Screenshot_2020-11-20-13-31-23](https://user-images.githubusercontent.com/6062888/99824924-204b5100-2b35-11eb-932c-9958f46d53f7.png)


### Related issues

- Fixes #1309

### Backwards compatibility

N/A
  • Loading branch information
gnardini authored Nov 25, 2020
1 parent 42c6f12 commit a2cf49d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/mobile/src/components/CeloAmountInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default function CeloAmountInput({
placeholder={'0'}
placeholderTextColor={colors.gray3}
keyboardType={'decimal-pad'}
autoCapitalize="words"
onChangeText={onCeloChanged}
value={celo}
testID={'CeloAmount'}
Expand Down
1 change: 1 addition & 0 deletions packages/mobile/src/exchange/ExchangeTradeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export class ExchangeTradeScreen extends React.Component<Props, State> {
<TextInput
autoFocus={true}
keyboardType={'decimal-pad'}
autoCapitalize="words"
onChangeText={this.onChangeExchangeAmount}
value={this.getInputValue()}
placeholderTextColor={colors.gray3}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ exports[`ExchangeTradeScreen renders correctly 1`] = `
</View>
<TextInput
allowFontScaling={true}
autoCapitalize="words"
autoFocus={true}
keyboardType="decimal-pad"
onChangeText={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ exports[`WithdrawCeloScreen renders correctly 1`] = `
>
<TextInput
allowFontScaling={true}
autoCapitalize="words"
keyboardType="decimal-pad"
onChangeText={[Function]}
placeholder="0"
Expand Down

0 comments on commit a2cf49d

Please sign in to comment.