-
Notifications
You must be signed in to change notification settings - Fork 69
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
Fix Link button alignment in the Checkout block #7994
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: -222 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes are working well, just a minor suggestion
client/checkout/utils/upe.js
Outdated
stripeLinkButton.style.display = 'none'; | ||
if ( emailInput.value !== '' ) { | ||
const linkButtonTop = | ||
emailInput.offsetTop + ( emailInput.offsetHeight - 40 ) / 2; | ||
stripeLinkButton.style.display = 'inline-block'; | ||
stripeLinkButton.style.top = `${ linkButtonTop }px`; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be working well! Have you considered using plain CSS for the positioning, instead of relying on JS?
I applied this CSS to the button.wcpay-stripelink-modal-trigger
selector in client/checkout/blocks/style.scss
, and it seems to be providing the same effect:
top: 50%;
transform: translateY(-50%);
I thought of using plain CSS so that there would be less JS for the browser to execute 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is much better. Thank you for pointing it out! I had to add some specificity because the blocks checkout stylesheet is loaded on shortcode checkout which causes problems with the link button there.
Fixes #7929
Changes proposed in this Pull Request
This ensures that the Stripe Link button is correctly aligned to the middle of the email input when viewing the Checkout block.
Before


After
Testing instructions
npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge