Skip to content
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(DatePicker): Arrow alignment #2292

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/neat-spies-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@razorpay/blade': patch
---

fix(blade): DatePicker range icon's alignment
15 changes: 9 additions & 6 deletions packages/blade/src/components/DatePicker/DateInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ const HiddenInput = ({
const iconVerticalMargin = {
medium: sizeTokens[14],
large: sizeTokens[24],
noLabel: sizeTokens[0],
noLabelM: sizeTokens[20],
noLabelL: sizeTokens[28],
} as const;
const LEFT_LABEL_WIDTH = 132;

Expand Down Expand Up @@ -212,16 +215,16 @@ const _DatePickerInput = (
{...referenceProps}
/>
</BaseBox>
<BaseBox flexShrink={0} alignSelf="start">
<BaseBox flexShrink={0} alignSelf="center">
<ArrowRightIcon
size="medium"
marginTop={
// Hacky layouting because the we cannot put this inside the internal layout of BaseInput.
// Label present ? add label height : remove label height; align basebox to center
hasLabel && (!isLabelPositionLeft || isMobile)
? `calc(${makeSize(iconVerticalMargin[size])} + ${makeSize(
isLarge ? sizeTokens[20] : sizeTokens[15],
)})`
: makeSize(iconVerticalMargin[size])
? isLarge
? makeSize(iconVerticalMargin.noLabelL)
: makeSize(iconVerticalMargin.noLabelM)
: makeSize(iconVerticalMargin.noLabel)
}
/>
</BaseBox>
Expand Down
Loading