Skip to content

Commit cfc2916

Browse files
committed
fix: avoid losing focus on shipping method selection
1 parent 0e54b5f commit cfc2916

4 files changed

Lines changed: 33 additions & 36 deletions

File tree

components/composite/StepShipping/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export const StepShipping: React.FC<Props> = () => {
240240
<ShippingSummary data-testid="shipping-methods-container">
241241
<StyledShippingMethodRadioButton
242242
data-testid="shipping-method-button"
243-
className="form-radio mt-0.5 md:mt-0"
243+
className="form-radio mt-0.5 md:mt-0 peer"
244244
onChange={(params) =>
245245
handleChange(params)
246246
}
@@ -253,7 +253,7 @@ export const StepShipping: React.FC<Props> = () => {
253253
props?.deliveryLeadTimeForShipment
254254
return (
255255
<label
256-
className="flex flex-col p-3 border rounded cursor-pointer hover:border-primary transition duration-200 ease-in"
256+
className="flex flex-col p-3 border rounded cursor-pointer hover:border-primary transition duration-200 ease-in peer-checked:border-2 peer-checked:border-primary peer-checked:shadow-md peer-checked:bg-gray-50"
257257
htmlFor={props.htmlFor}
258258
>
259259
<ShippingLineItemTitle>

components/composite/StepShipping/styled.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ export const ShippingTitle = styled.h4`
1515
`
1616
export const ShippingSummary = styled.div`
1717
${tw`contents`}
18-
input:checked + label {
19-
${tw`border-2 border-primary shadow-md bg-gray-50`}
20-
}
2118
`
2219
export const ShippingSummaryItem = styled.div`
2320
${tw`flex flex-1 font-bold ml-2 flex-col md:flex-row`}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"commercelayer"
7373
],
7474
"dependencies": {
75-
"@commercelayer/react-components": "^4.6.0",
75+
"@commercelayer/react-components": "4.7.1-beta.0",
7676
"@commercelayer/sdk": "^5.15.0",
7777
"@faker-js/faker": "^8.1.0",
7878
"@headlessui/react": "^1.7.17",

pnpm-lock.yaml

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)