-
Notifications
You must be signed in to change notification settings - Fork 16
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
Focus shift in CardElement
#236
Comments
I think this is a good FR .. potentially with a direct way of pushing focus into the various sub-elements within the |
@chrissrogers @ashbork Moreover, when Upgrading from Hosted Fields to Elements, it is now throwing an error minimum reproduceable code:
|
Hi! I'm not a member of the project and can only aid you in the first question - the behavior is shown in an example in the docs, specifically |
That demo is not up to date i believe since the components dont accept a ref |
That demo seems to be running |
Just tried it with the element component (as in the demo & your ex.) but ref is not accepted by the comp (error thrown by typescript & ref.current is null) |
You need to initialize the ref with const cardCvvElement = React.useRef(null); The demo doesn't do that because it isn't necessary without TypeScript. |
Still not accepted by the component. And fails to attach a value
|
I can reproduce this now, which is odd because I had focus shifting working. I'll try to reproduce it soon in the environment where that worked for me when I have some time. Sorry I couldn't be of more help, hope someone associated with the project can chime in! |
Thanks ash, yes i hope this gets addressed as its a common use of case |
Hi! Currently, the only way to shift focus automatically when specific parts of the CC form are filled is if the elements are Individual Card Elements. I was wondering if it'd be possible to make this functionality work out of the box in the single
CardElement
component? Exposing it as a prop (focusShift? = false
) could be a good idea to prevent breaking backwards-compatibility. What do you think?The text was updated successfully, but these errors were encountered: