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 5 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': major
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'@razorpay/blade': major
'@razorpay/blade': patch

---

"DatePicker range icon's margin top fixed"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"DatePicker range icon's margin top fixed"
fix(blade): DatePicker range icon's alignment

23 changes: 17 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,24 @@ const _DatePickerInput = (
{...referenceProps}
/>
</BaseBox>
<BaseBox flexShrink={0} alignSelf="start">
<BaseBox flexShrink={0} alignSelf="center">
<ArrowRightIcon
size="medium"
// marginTop={
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove commented code

// // Hacky layouting because the we cannot put this inside the internal layout of BaseInput.
// hasLabel && (!isLabelPositionLeft || isMobile)
// ? `calc(${makeSize(iconVerticalMargin[size])} + ${makeSize(
// isLarge ? sizeTokens[20] : sizeTokens[15],
// )})`
// : makeSize(iconVerticalMargin[size])
// }
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