return of the autocomplete! (and remove spellcheck on names) (#296) (#297)

This commit is contained in:
Alexandra Usacheva 2019-10-21 13:16:55 +03:00 committed by GitHub
parent d115f2fbac
commit 9e8645aa5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,8 @@ const getCustomInput = (props: CardHolderProps, fieldProps: WrappedFieldProps) =
mark={true}
id="card-holder-input"
onInput={formatCardHolder}
autocomplete="cc-name"
spellcheck={false}
/>
);

View File

@ -37,6 +37,7 @@ const getCardNumberInput = (props: CardNumberProps, fieldProps: WrappedFieldProp
type="tel"
id="card-number-input"
onInput={formatCardNumber}
autocomplete="cc-number"
/>
);

View File

@ -25,6 +25,7 @@ const getCustomInput = (props: ExpireDateProps, fieldProps: WrappedFieldProps) =
type="tel"
id="expire-date-input"
onInput={formatExpiry}
autocomplete="cc-exp"
/>
);

View File

@ -28,6 +28,7 @@ const getCustomInput = (props: SecureCodeProps, fieldProps: WrappedFieldProps) =
mark={true}
type={props.obscureCardCvv ? 'password' : 'tel'}
id="secure-code-input"
autocomplete="cc-csc"
/>
);

View File

@ -25,6 +25,7 @@ const getCustomInput = (props: EmailDefProps, fieldProps: WrappedFieldProps) =>
type="email"
id="email-input"
onInput={formatEmail}
autocomplete="email"
/>
);

View File

@ -26,6 +26,7 @@ const getCustomInput = (props: PhoneProps, fieldProps: WrappedFieldProps) => (
id="phone-input"
onInput={formatPhoneNumber}
onFocus={formatPhoneNumber}
autocomplete="tel"
/>
);

View File

@ -86,6 +86,8 @@ export interface CustomProps {
type?: 'text' | 'number' | 'value' | 'tel' | 'email' | 'password';
id?: string;
onInput?: React.FormEventHandler<HTMLInputElement>;
autocomplete?: string;
spellcheck?: boolean;
}
type InputProps = WrappedFieldInputProps & WrappedFieldMetaProps & CustomProps;
@ -104,6 +106,8 @@ export const Input: React.FC<InputProps> = (props) => (
type={props.type}
value={props.value}
id={props.id}
autoComplete={props.autocomplete}
spellCheck={props.spellcheck}
/>
{props.mark && <Marks active={props.active} pristine={props.pristine} error={props.error} />}
</InputWrapper>