mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Merge pull request #981 from woocommerce/pcp-966-prevent-enter
Prevent Enter key submit for our non-standard button gateways
This commit is contained in:
commit
967e40633e
1 changed files with 10 additions and 0 deletions
|
@ -30,6 +30,16 @@ const bootstrap = () => {
|
|||
|
||||
const freeTrialHandler = new FreeTrialHandler(PayPalCommerceGateway, spinner, errorHandler);
|
||||
|
||||
jQuery('form.woocommerce-checkout input').on('keydown', e => {
|
||||
if (e.key === 'Enter' && [
|
||||
PaymentMethods.PAYPAL,
|
||||
PaymentMethods.CARDS,
|
||||
PaymentMethods.CARD_BUTTON,
|
||||
].includes(getCurrentPaymentMethod())) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
const onSmartButtonClick = (data, actions) => {
|
||||
window.ppcpFundingSource = data.fundingSource;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue