Skip to content

Commit

Permalink
Merge pull request #53647 from software-mansion-labs/289Adam289/51868…
Browse files Browse the repository at this point in the history
…-fix-decimal-pad-input-lag

Fix decimal-pad keyboard input lag on android
  • Loading branch information
techievivek authored Dec 11, 2024
2 parents a166f5a + 1ded5ce commit 40a101a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/AmountForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ function AmountForm(
prefixCharacter={currency}
prefixStyle={styles.colorMuted}
keyboardType={CONST.KEYBOARD_TYPE.DECIMAL_PAD}
// On android autoCapitalize="words" is necessary when keyboardType="decimal-pad" or inputMode="decimal" to prevent input lag.
// See https://github.com/Expensify/App/issues/51868 for more information
autoCapitalize="words"
inputMode={CONST.INPUT_MODE.DECIMAL}
errorText={errorText}
// eslint-disable-next-line react/jsx-props-no-spreading
Expand Down
3 changes: 3 additions & 0 deletions src/components/AmountTextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ function AmountTextInput(
value={formattedAmount}
placeholder={placeholder}
inputMode={CONST.INPUT_MODE.DECIMAL}
// On android autoCapitalize="words" is necessary when keyboardType="decimal-pad" or inputMode="decimal" to prevent input lag.
// See https://github.com/Expensify/App/issues/51868 for more information
autoCapitalize="words"
blurOnSubmit={false}
selection={selection}
onSelectionChange={onSelectionChange}
Expand Down
3 changes: 3 additions & 0 deletions src/components/AmountWithoutCurrencyForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ function AmountWithoutCurrencyForm(
role={role}
ref={ref}
keyboardType={CONST.KEYBOARD_TYPE.DECIMAL_PAD}
// On android autoCapitalize="words" is necessary when keyboardType="decimal-pad" or inputMode="decimal" to prevent input lag.
// See https://github.com/Expensify/App/issues/51868 for more information
autoCapitalize="words"
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
/>
Expand Down
3 changes: 3 additions & 0 deletions src/components/PercentageForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ function PercentageForm({value: amount, errorText, onInputChange, label, ...rest
}}
suffixCharacter="%"
keyboardType={CONST.KEYBOARD_TYPE.DECIMAL_PAD}
// On android autoCapitalize="words" is necessary when keyboardType="decimal-pad" or inputMode="decimal" to prevent input lag.
// See https://github.com/Expensify/App/issues/51868 for more information
autoCapitalize="words"
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ function BankAccountValidationForm({requiresTwoFactorAuth, reimbursementAccount,
},
[reimbursementAccount, policyID, permittedDecimalSeparator],
);
// On android autoCapitalize="words" is necessary when keyboardType="decimal-pad" or inputMode="decimal" to prevent input lag.
// See https://github.com/Expensify/App/issues/51868 for more information
return (
<FormProvider
formID={ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM}
Expand All @@ -114,6 +116,7 @@ function BankAccountValidationForm({requiresTwoFactorAuth, reimbursementAccount,
shouldSaveDraft
containerStyles={[styles.mb6]}
inputMode={CONST.INPUT_MODE.DECIMAL}
autoCapitalize="words"
label={`${translate('connectBankAccountStep.validationInputLabel')} 1`}
maxLength={CONST.VALIDATION_REIMBURSEMENT_INPUT_LIMIT}
/>
Expand All @@ -123,6 +126,7 @@ function BankAccountValidationForm({requiresTwoFactorAuth, reimbursementAccount,
shouldSaveDraft
containerStyles={[styles.mb6]}
inputMode={CONST.INPUT_MODE.DECIMAL}
autoCapitalize="words"
label={`${translate('connectBankAccountStep.validationInputLabel')} 2`}
maxLength={CONST.VALIDATION_REIMBURSEMENT_INPUT_LIMIT}
/>
Expand All @@ -132,6 +136,7 @@ function BankAccountValidationForm({requiresTwoFactorAuth, reimbursementAccount,
inputID={INPUT_IDS.AMOUNT3}
containerStyles={[styles.mb6]}
inputMode={CONST.INPUT_MODE.DECIMAL}
autoCapitalize="words"
label={`${translate('connectBankAccountStep.validationInputLabel')} 3`}
maxLength={CONST.VALIDATION_REIMBURSEMENT_INPUT_LIMIT}
/>
Expand Down

0 comments on commit 40a101a

Please sign in to comment.