Comments (6)
So far I wasn't able to reproduce the issue.
However, I noticed two things:
- You are not setting
inputProps={{ autoComplete: "one-time-code" }}
on the component. According to Apple this is required to enable autocomplete and I don't get the option to fill in codes without setting this attribute on the input. Is this maybe something that changed in iOS 15 (I can only test 14.3 atm) or do you have another explanation? - Your value of
validChars="[0-9]*"
allows the user to enter an arbitrary number of digits, which is probably not what you want. Use a value of0-9
to allow only digits (and use thelength
prop to set a custom length if needed). Still I'm not sure if this is related to the problem since I didn't encounter any issues even when using your value.
I couldn't find any differences in behavior between Safari and Chrome, either.
Btw, what's the purpose of using react-hook-form
for this? Seems to me like simply using React state would be way easier for this very simple form.
from react-verification-input.
I just tested with Safari and Chrome on iOS 14.3 which both worked as expected.
So it looks like the problem is more specific.
To investigate I need more information:
- version of package, iOS, etc.
- exact setup (snippet or complete code example)
- what do you mean by "breaks"?
- are you doing/using something "unusual"?
from react-verification-input.
Hello Andreas, thank you for reaching out.
The package version is 2.0.4 and iOS 15.3.1.
The code for Code input is:
const CodeInput: FC<CodeInputProps> = ({ value, onChange }) => {
return (
<VerificationInput
value={value}
onChange={onChange}
placeholder=""
classNames={codeStyles}
validChars="[0-9]*"
removeDefaultStyles
autoFocus
/>
}
The action:
const onChangeValue = (value: string) => {
setValue(ConfirmCodeField.Code, value);
// -- I also tried without this part below
if (value.length === 6) {
onConfirmCode(value);
}
// -- still doesn't work for me
};
const { code = '' } = useWatch<FormInputs>({ control });
Usage:
<CodeInput onChange={onChangeValue} value={code} disabled={isLoading} />
I'm using react-hook-form
The current flow is: Open Safari on iPhone > Login screen > Enter email > Receive SMS > Try autofill the CODE (screenshot below) > It redirects you back to the login screen, without any error message.
from react-verification-input.
Thanks for the information. I'll look into it.
from react-verification-input.
@anurbecirovic Hello anurbecirovic if this issue is resolved with you or not ?
from react-verification-input.
Hello @mohamedomara0. I tried but haven't had luck with it. I left this issue in the app since it wasn't big blocker.
from react-verification-input.
Related Issues (20)
- Fix broken github status badge
- Error when building in vite app HOT 5
- Add `onComplete` optional prop HOT 4
- Edge Browser Hide Password Toggle
- Needs ability to style the `vi__wrapper` div HOT 12
- OTP Autocomplete issue (Safari) HOT 2
- Can support the function of copying and pasting shortcut keys? HOT 2
- how to disable input during validation? HOT 2
- Safari autocomplete problem HOT 1
- Input still has "vi__character--selected" class after disabling input through inputProps HOT 3
- Request: Ability to select specific characters for deletion in OTP Input. HOT 1
- Fix "mobile zoom" not working like regular input fields
- Meta tag info (README): make sure this is up to date and consider removing user-scalable=no
- disable spell check HOT 1
- broken input styles HOT 1
- adding custom class names should not remove default class names HOT 1
- Manually selecting one of the fields HOT 1
- Can't type or paste this code: 008003 HOT 2
- Add caret HOT 3
- enable syntax highlighting on docs website
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-verification-input.