Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Chrome: PhoneInput with maxLength and smartCaret has weird cursor side effects #434

Open
jonathan-villanueva opened this issue Oct 5, 2023 · 3 comments
Labels

Comments

@jonathan-villanueva
Copy link

When entering more than the max amount of digits on Android Chrome the cursor will move back and be positioned strangely.

Screen.Recording.2023-10-05.at.12.31.43.PM.mov
@catamphetamine
Copy link
Owner

Post your code.

P.S. I dunno what might be the case in your case, so there won't be a solution in this thread.

@jonathan-villanueva
Copy link
Author

jonathan-villanueva commented Oct 6, 2023

                        <PhoneInput
                            data-testid="PhoneInputInput"
                            country="US"
                            value={value || undefined}
                            onChange={onChange}
                            type="tel"
                            defaultCountry="US"
                            autoFocus={true}
                            limitMaxLength={true}
                        />
    const onChange = (value: string) => {
        setFormData({ ...formData, phone_number: value })
    }

@catamphetamine
Copy link
Owner

I see, so the bug only manifests when limitMaxLength property is used.

I saw weird caret behavior on Android in the past years. Usually it happens in unconventional browsers that don't handle dynamic caret positioning properly. In the older years, that was Samsung Browser, for example.

I'd mark this one as "won't fix".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants