fix(password) use the numeric input mode when only digits are required

Fixes: https://github.com/jitsi/brave-tracker/issues/101
This commit is contained in:
Saúl Ibarra Corretgé
2023-06-16 13:11:02 +02:00
committed by Saúl Ibarra Corretgé
parent 2292ebe762
commit 48e1f443ea
2 changed files with 16 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ interface IProps extends IInputProps {
maxValue?: number;
minRows?: number;
minValue?: number;
mode?: 'text' | 'none' | 'decimal' | 'numeric' | 'tel' | 'search' | ' email' | 'url';
name?: string;
onBlur?: (e: any) => void;
onFocus?: (event: React.FocusEvent) => void;
@@ -162,6 +163,7 @@ const Input = React.forwardRef<any, IProps>(({
maxRows,
minValue,
minRows,
mode,
name,
onBlur,
onChange,
@@ -223,6 +225,7 @@ const Input = React.forwardRef<any, IProps>(({
data-testid = { testId }
disabled = { disabled }
{ ...(id ? { id } : {}) }
{ ...(mode ? { inputmode: mode } : {}) }
{ ...(type === 'number' ? { max: maxValue } : {}) }
maxLength = { maxLength }
{ ...(type === 'number' ? { min: minValue } : {}) }