fix(LOY-251): numeric inputmode on inputs for mobile numeric keyboard
This commit is contained in:
@@ -73,6 +73,7 @@ export default function FormContent() {
|
|||||||
label={zipCode}
|
label={zipCode}
|
||||||
name="address.zipCode"
|
name="address.zipCode"
|
||||||
registerOptions={{ required: true }}
|
registerOptions={{ required: true }}
|
||||||
|
inputMode="numeric"
|
||||||
/>
|
/>
|
||||||
<CountrySelect
|
<CountrySelect
|
||||||
label={country}
|
label={country}
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ export default function SignupForm({ title }: SignUpFormProps) {
|
|||||||
label={zipCode}
|
label={zipCode}
|
||||||
name="address.zipCode"
|
name="address.zipCode"
|
||||||
registerOptions={{ required: true }}
|
registerOptions={{ required: true }}
|
||||||
|
inputMode="numeric"
|
||||||
/>
|
/>
|
||||||
<CountrySelect
|
<CountrySelect
|
||||||
label={country}
|
label={country}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export default function Signup({
|
|||||||
defaultMessage: "Zip code",
|
defaultMessage: "Zip code",
|
||||||
})}
|
})}
|
||||||
registerOptions={{ required: true, ...registerOptions }}
|
registerOptions={{ required: true, ...registerOptions }}
|
||||||
|
inputMode="numeric"
|
||||||
/>
|
/>
|
||||||
<div className={styles.dateField}>
|
<div className={styles.dateField}>
|
||||||
<header>
|
<header>
|
||||||
|
|||||||
@@ -134,6 +134,7 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
|||||||
isInvalid={fieldState.invalid}
|
isInvalid={fieldState.invalid}
|
||||||
onBlur={field.onBlur}
|
onBlur={field.onBlur}
|
||||||
defaultSelectedKey={dateValue?.day}
|
defaultSelectedKey={dateValue?.day}
|
||||||
|
inputMode="numeric"
|
||||||
data-testid={DateName.day}
|
data-testid={DateName.day}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -166,6 +167,7 @@ export default function DateSelect({ name, registerOptions = {} }: DateProps) {
|
|||||||
isInvalid={fieldState.invalid}
|
isInvalid={fieldState.invalid}
|
||||||
onBlur={field.onBlur}
|
onBlur={field.onBlur}
|
||||||
defaultSelectedKey={dateValue?.year}
|
defaultSelectedKey={dateValue?.year}
|
||||||
|
inputMode="numeric"
|
||||||
data-testid={DateName.year}
|
data-testid={DateName.year}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
|||||||
registerOptions = {},
|
registerOptions = {},
|
||||||
type = "text",
|
type = "text",
|
||||||
hideError,
|
hideError,
|
||||||
|
inputMode,
|
||||||
},
|
},
|
||||||
ref
|
ref
|
||||||
) {
|
) {
|
||||||
@@ -74,6 +75,7 @@ const Input = forwardRef<HTMLInputElement, InputProps>(function Input(
|
|||||||
readOnly={readOnly}
|
readOnly={readOnly}
|
||||||
required={!!registerOptions.required}
|
required={!!registerOptions.required}
|
||||||
type={type}
|
type={type}
|
||||||
|
inputMode={inputMode}
|
||||||
/>
|
/>
|
||||||
{helpText && !fieldState.error ? (
|
{helpText && !fieldState.error ? (
|
||||||
<Caption asChild color="black">
|
<Caption asChild color="black">
|
||||||
|
|||||||
@@ -93,6 +93,7 @@ export function SelectFilter({
|
|||||||
onFocus = () => undefined,
|
onFocus = () => undefined,
|
||||||
onBlur = () => undefined,
|
onBlur = () => undefined,
|
||||||
autoComplete,
|
autoComplete,
|
||||||
|
inputMode,
|
||||||
...props
|
...props
|
||||||
}: SelectFilterProps) {
|
}: SelectFilterProps) {
|
||||||
const [focus, setFocus] = useState(false)
|
const [focus, setFocus] = useState(false)
|
||||||
@@ -146,6 +147,7 @@ export function SelectFilter({
|
|||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
className={styles.input}
|
className={styles.input}
|
||||||
autoComplete={autoComplete}
|
autoComplete={autoComplete}
|
||||||
|
inputMode={inputMode}
|
||||||
/>
|
/>
|
||||||
</Typography>
|
</Typography>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ComponentProps } from 'react'
|
import { ComponentProps, InputHTMLAttributes } from 'react'
|
||||||
import { ComboBox, Key, ListBoxItem, Select } from 'react-aria-components'
|
import { ComboBox, Key, ListBoxItem, Select } from 'react-aria-components'
|
||||||
import { MaterialIconProps } from '../Icons/MaterialIcon'
|
import { MaterialIconProps } from '../Icons/MaterialIcon'
|
||||||
|
|
||||||
@@ -26,7 +26,8 @@ export interface SelectItemProps extends ComponentProps<typeof ListBoxItem> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface SelectFilterProps extends ComponentProps<typeof ComboBox> {
|
export interface SelectFilterProps extends ComponentProps<typeof ComboBox> {
|
||||||
autoComplete?: string
|
autoComplete?: InputHTMLAttributes<HTMLInputElement>['autoComplete']
|
||||||
|
inputMode?: InputHTMLAttributes<HTMLInputElement>['inputMode']
|
||||||
icon?: MaterialIconProps['icon']
|
icon?: MaterialIconProps['icon']
|
||||||
itemIcon?: MaterialIconProps['icon']
|
itemIcon?: MaterialIconProps['icon']
|
||||||
items: Item[]
|
items: Item[]
|
||||||
|
|||||||
Reference in New Issue
Block a user