diff --git a/src/components/hv-text-field/index.tsx b/src/components/hv-text-field/index.tsx index e68ac49cf..21655d931 100644 --- a/src/components/hv-text-field/index.tsx +++ b/src/components/hv-text-field/index.tsx @@ -41,6 +41,15 @@ const HvTextField = (props: HvComponentProps) => { const textContentType = (props.element.getAttribute('text-content-type') as TextContextType) || 'none'; + // Force email addresses to have no auto-capitalization, others use default + const defaultCapitalization = + keyboardType === 'email-address' ? 'none' : undefined; + const autoCapitalize = + (props.element.getAttribute('auto-capitalize') as + | 'none' + | 'sentences' + | 'words' + | 'characters') || defaultCapitalization; // Handlers const setFocus = (focused: boolean) => { @@ -104,6 +113,7 @@ const HvTextField = (props: HvComponentProps) => { props.options.registerInputHandler(ref); } }} + autoCapitalize={autoCapitalize} autoFocus={autoFocus} defaultValue={defaultValue} editable={editable}