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

Submit the form by pressing the Enter key with the custom card integration #1881

Open
pguilbert opened this issue Dec 12, 2022 · 5 comments
Open
Labels
Enhancement New feature or request Progress: on hold v6 Included in the next major release

Comments

@pguilbert
Copy link

Is your feature request related to a problem? Please describe.
I'm doing a custom card integration. As a user, I would like to be able to submit the form by pressing the Enter key (default browser behavior for native forms).

Describe the solution you'd like
Add an onSubmit callback (next to onFieldValid / onChange, etc...) that is called when the user presses enter in the iframe fields.

Describe alternatives you've considered
AFAIK, there is no other way to do this (?)

@pguilbert pguilbert added the Enhancement New feature or request label Dec 12, 2022
@ribeiroguilherme
Copy link
Contributor

Hi @pguilbert ,

Does this answer your question?

We do not capture "Enter" key presses on the credit card fields. We expect users to Tab between fields and when they have Tabbed onto the Pay button, pressing Enter will then validate/submit the form

from #1242

@ribeiroguilherme ribeiroguilherme added Needs more info Further information is requested duplicate This issue or pull request already exists labels Dec 19, 2022
@pguilbert
Copy link
Author

pguilbert commented Dec 21, 2022

Hi,

Not really. I would like to offer the user the same experience as in an html form.
For that, the only thing that is missing is the ability to submit the form with the "Enter" key.

In my opinion having an onSubmit callback will allow me to add the functionality without introducing any breaking changes for existing forms.

@ribeiroguilherme
Copy link
Contributor

ribeiroguilherme commented Jan 17, 2023

Hi @pguilbert ,

The onSubmit callback already exists and it is used to perform the /payments call . It would make more sense to provide something like onEnterPress for example.

I discussed internally with the team and we created a ticket to check this out. It isn't as simple as it sounds though, as it would impact not only Card but also other payment methods.

Regardless of that, we have other priorities at the moment, but we will make sure to keep this ticket updated with the progress. Cheers

@ribeiroguilherme ribeiroguilherme added Progress: on hold and removed duplicate This issue or pull request already exists Needs more info Further information is requested labels Jan 17, 2023
@obouchari
Copy link

obouchari commented Apr 29, 2023

I have a custom button using components, when calling submit() the form doesn't seem to show any validation errors! Am I missing something?
Also, adding {showPayButton: true} to config doesn't seem to work either, form still doesn’t show any errors.

@ondrakub
Copy link

hi, any progress on this issue? we would also like to submit the form using enter. This is a common behavior that users are used to and would improve the experience.

@sponglord sponglord added the v6 Included in the next major release label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Progress: on hold v6 Included in the next major release
Projects
None yet
Development

No branches or pull requests

5 participants