feat(web,input) add hint for 1Password to ignore input fields

When autoComplete is set to off, at least.
This commit is contained in:
Saúl Ibarra Corretgé
2025-04-14 16:14:25 +02:00
committed by Saúl Ibarra Corretgé
parent af4f122602
commit ce4cbacceb

View File

@@ -188,6 +188,7 @@ const Input = React.forwardRef<any, IProps>(({
const { classes: styles, cx } = useStyles();
const isMobile = isMobileBrowser();
const showClearIcon = clearable && value !== '' && !disabled;
const inputAutoCompleteOff = autoComplete === 'off' ? { 'data-1p-ignore': '' } : {};
const handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) =>
onChange?.(e.target.value), []);
@@ -250,6 +251,7 @@ const Input = React.forwardRef<any, IProps>(({
data-testid = { testId }
disabled = { disabled }
id = { id }
{ ...inputAutoCompleteOff }
{ ...(mode ? { inputmode: mode } : {}) }
{ ...(type === 'number' ? { max: maxValue } : {}) }
maxLength = { maxLength }