Skip to content

Commit

Permalink
feat: close popover on click
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurFerrao committed Nov 25, 2024
1 parent 445a252 commit fd1c48d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion react/components/ShippingOptionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ const ShippingOptionButton = ({
setIsPopoverOpen(false)
}

const handlePopoverClick = () => {
onClick()
setIsPopoverOpen(false)
}

const openPopover = !loading && !value && showPopover && isPopoverOpen

return (
Expand Down Expand Up @@ -68,7 +73,7 @@ const ShippingOptionButton = ({
<DeliveryPopover
buttonLabel={intl.formatMessage(messages.popoverButtonLabel)}
description={intl.formatMessage(messages.popoverDescription)}
onClick={onClick}
onClick={handlePopoverClick}
handleOutSideClick={handleOutSideClick}
/>
)}
Expand Down

0 comments on commit fd1c48d

Please sign in to comment.