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
Changes from 1 commit
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
Next Next commit
Fix issue #2256
k-parihar committed Jul 2, 2024
commit d72a7ea06c8dc365ccbb8b4197c972ed962d52a7
25 changes: 18 additions & 7 deletions packages/blade/src/components/DatePicker/DateInput.web.tsx
Original file line number Diff line number Diff line change
@@ -52,6 +52,9 @@ const HiddenInput = ({ value, name }: { value: string; name?: string }): React.R
const iconVerticalMargin = {
medium: sizeTokens[14],
large: sizeTokens[24],
noLabel: sizeTokens[0],
noLabelM: sizeTokens[20],
noLabelL: sizeTokens[28],
} as const;
const LEFT_LABEL_WIDTH = 132;

@@ -179,16 +182,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.
hasLabel && (!isLabelPositionLeft || isMobile)
? `calc(${makeSize(iconVerticalMargin[size])} + ${makeSize(
isLarge ? sizeTokens[20] : sizeTokens[15],
)})`
: makeSize(iconVerticalMargin[size])
// Label present ? add label height : remove label height; align basebox to center
hasLabel
? isLarge
? makeSize(iconVerticalMargin['noLabelL'])
: makeSize(iconVerticalMargin['noLabelM'])
: makeSize(iconVerticalMargin['noLabel'])
}
/>
</BaseBox>