Easily create PCI-compliant inputs to accept payments online with the Square Payments API. It supports the following payment methods: credit and debit cards, ACH bank transfers, Apple Pay, Google Pay, Gift Cards and Afterpay/Clearpay.
[x] Make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
[x] Make sure you are making a pull request against the main branch (left side). Also you should start your branch off our main.
[x] Check the commit's or even all commits' message styles matches our requested structure.
[x] Check your code additions will fail neither code linting checks nor unit test.
Description
By setting a default value for the 'focus' parameter of CreditCard, you cannot disable the autofocus on form loading in TypeScript without using a @ts-ignore annotation.
See
<CreditCard
// @ts-ignore
focus={""} />
Trying to set it as focus={undefined} still results in the default value being set. By not setting a default, customization is allowed for this field. And it seems I'm not the only person looking for this functonality:
Your checklist for this pull request
🚨Please review the guidelines for contributing to this repository.
Description
By setting a default value for the 'focus' parameter of CreditCard, you cannot disable the autofocus on form loading in TypeScript without using a
@ts-ignore
annotation.See
Trying to set it as
focus={undefined}
still results in the default value being set. By not setting a default, customization is allowed for this field. And it seems I'm not the only person looking for this functonality:See https://developer.squareup.com/forums/t/how-to-remove-focus-when-squarepaymentsform-and-creditcardinput-is-rendered-in-the-ui/6449 🧡 Thank you!