Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Hungary and Japan postcode position is not respected in Checkout. #10721

Closed
senadir opened this issue Aug 24, 2023 · 4 comments · Fixed by #11486
Closed

Hungary and Japan postcode position is not respected in Checkout. #10721

senadir opened this issue Aug 24, 2023 · 4 comments · Fixed by #11486
Assignees
Labels
block: checkout Issues related to the checkout block. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue/PR concerns a confirmed bug.

Comments

@senadir
Copy link
Member

senadir commented Aug 24, 2023

Discussed in https://github.com/woocommerce/woocommerce-blocks/discussions/10693

Originally posted by passatgt August 22, 2023
Hi! I just noticed that there are some inconsistency on how the form fields are rendered with the checkout block. To give you some examples:

With Hungary, notice theres two empty spaces:

image (also with Hungary, we could hide the state field, since it is not used anymore for shipping or billing, we don't need to collect this info, but this is another topic)

With Germany, the address field jumps to the top:

image

With Japan, the layout looks okay, however if you check the country locale, the postcode field should be on the left, and the state field on the right:

image image

The form-row-first and form-row-last classes are ignored in the checkout block. However, only Japan and Hungary actually uses these classes when defining the locale.

On the old checkout, both Hungary and Japan looks good, because the country field is 100% wide:

image image

And on the old checkout, street address was below the country field:

image

Not sure about the solution, but something to think about. Both Hungary and Japan could be fixed in the locale to match the other countries, but the empty space would still be there and it would mess with the layout of the old checkout, since both are coming from the same function.

@senadir senadir added type: bug The issue/PR concerns a confirmed bug. block: checkout Issues related to the checkout block. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. labels Aug 24, 2023
@nielslange
Copy link
Member

Not sure about the solution, but something to think about. Both Hungary and Japan could be fixed in the locale to match the other countries, but the empty space would still be there and it would mess with the layout of the old checkout, since both are coming from the same function.

Similar to the PR for displaying express payment buttons, we could address this issue using flexbox.

We could wrap each row in an outer div. If there's one inner div, that div has a width of 100%. If there are two inner divs, each div has a width of 50%. Here's a brief example of how this could be accomplished:

<div class="outer">
    <div>Inner Div 1</div>
</div>

<div class="outer">
    <div>Inner Div 1</div>
    <div>Inner Div 2</div>
</div>
.outer {
    display: flex;
}

.outer > div {
    flex: 1;
}

Here's a live demo: https://codepen.io/nielslange/pen/jOXbzxe?editors=1100

@ralucaStan
Copy link
Contributor

@tarhi-saad could you try to replicate this issue? I appreciate the help

@tarunvijwani
Copy link

@ralucaStan I'm able to reproduce the issue.

@ralucaStan
Copy link
Contributor

Thank you Tarun, adding this to the current sprint

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
block: checkout Issues related to the checkout block. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
5 participants