Merge pull request #2895 from woocommerce/PCP-3919-save-changes-is-grey-and-unclickable-when-switching-from-sandbox-to-live

“Save changes” is grey and unclickable when switching from Sandbox to Live
This commit is contained in:
Niklas Gutberlet 2024-12-23 12:35:38 +01:00 committed by GitHub
commit 6115ffb457
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -345,6 +345,10 @@ window.ppcp_onboarding_productionCallback = function ( ...args ) {
const sandboxSwitchElement = document.querySelector( '#ppcp-sandbox_on' );
sandboxSwitchElement?.addEventListener( 'click', () => {
document.querySelector( '.woocommerce-save-button' )?.removeAttribute( 'disabled' );
});
const validate = () => {
const selectors = sandboxSwitchElement.checked
? sandboxCredentialElementsSelectors