react-stripe-js icon indicating copy to clipboard operation
react-stripe-js copied to clipboard

[BUG]: Need to not be able submit a form with Return Key

Open gabrielmirandat opened this issue 7 months ago • 0 comments

What happened?

I am using stripe CardElement, and when pressing Return key inside it my submit handler is called. But I have a use case here that it must not be possible submit my form with Return key (actually with any keyboard key), only with my button. As it is not possible to get keydown events from CardElement due to security matters, how can I be able to do that? I saw there exists an onEscape event when scape is pressed inside the component...could that have a onReturn so I can prevent it there? Please, show me a light in the end of the tunnel. Thanks.

Environment

No response

Reproduction

No response

gabrielmirandat avatar Jul 03 '24 18:07 gabrielmirandat