[Accessibility] Fix focus order on checkout block page (#49649)

* Render total blocks before fields on checkout

* Reverse checkout total blocks position on desktop

* Add changelog file

* Add conditional styles to reverse checkout blocks order

---------

Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com>
This commit is contained in:
Gabriel Manussakis 2024-08-20 10:42:38 -03:00 committed by GitHub
parent ce98e51430
commit c9aa65a22f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 1 deletions

View File

@ -4,6 +4,10 @@
margin: 0 auto $gap;
position: relative;
&:has(> :last-child.wp-block-woocommerce-checkout-fields-block) {
flex-direction: row-reverse;
}
.wc-block-must-login-prompt {
display: block;
}

View File

@ -86,8 +86,8 @@ export const Edit = ( {
}, [ clientId ] );
const defaultTemplate = [
[ 'woocommerce/checkout-fields-block', {}, [] ],
[ 'woocommerce/checkout-totals-block', {}, [] ],
[ 'woocommerce/checkout-fields-block', {}, [] ],
] as TemplateArray;
const toggleAttribute = ( key: keyof Attributes ): void => {

View File

@ -8,6 +8,10 @@
align-items: flex-start;
padding-left: 5px;
&:has(> :first-child.wp-block-woocommerce-checkout-totals-block) {
flex-direction: row-reverse;
}
.wc-block-checkout__additional_fields {
padding: 0;
}

View File

@ -43,6 +43,11 @@
flex-wrap: wrap;
margin: 0 auto $gap;
position: relative;
&:has(> :last-child.wp-block-woocommerce-checkout-fields-block) {
flex-direction: row-reverse;
}
.wp-block-woocommerce-checkout-totals-block {
width: 35%;
padding-left: math.percentage(math.div($gap-large, 1060px));

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Fix focus order on checkout block page.