Skip to content

Commit d72a7ea

Browse files
committed
Fix issue razorpay#2256
1 parent 06a2ecd commit d72a7ea

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

packages/blade/src/components/DatePicker/DateInput.web.tsx

+18-7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ const HiddenInput = ({ value, name }: { value: string; name?: string }): React.R
5252
const iconVerticalMargin = {
5353
medium: sizeTokens[14],
5454
large: sizeTokens[24],
55+
noLabel: sizeTokens[0],
56+
noLabelM: sizeTokens[20],
57+
noLabelL: sizeTokens[28],
5558
} as const;
5659
const LEFT_LABEL_WIDTH = 132;
5760

@@ -179,16 +182,24 @@ const _DatePickerInput = (
179182
{...referenceProps}
180183
/>
181184
</BaseBox>
182-
<BaseBox flexShrink={0} alignSelf="start">
185+
<BaseBox flexShrink={0} alignSelf="center">
183186
<ArrowRightIcon
184187
size="medium"
188+
// marginTop={
189+
// // Hacky layouting because the we cannot put this inside the internal layout of BaseInput.
190+
// hasLabel && (!isLabelPositionLeft || isMobile)
191+
// ? `calc(${makeSize(iconVerticalMargin[size])} + ${makeSize(
192+
// isLarge ? sizeTokens[20] : sizeTokens[15],
193+
// )})`
194+
// : makeSize(iconVerticalMargin[size])
195+
// }
185196
marginTop={
186-
// Hacky layouting because the we cannot put this inside the internal layout of BaseInput.
187-
hasLabel && (!isLabelPositionLeft || isMobile)
188-
? `calc(${makeSize(iconVerticalMargin[size])} + ${makeSize(
189-
isLarge ? sizeTokens[20] : sizeTokens[15],
190-
)})`
191-
: makeSize(iconVerticalMargin[size])
197+
// Label present ? add label height : remove label height; align basebox to center
198+
hasLabel
199+
? isLarge
200+
? makeSize(iconVerticalMargin['noLabelL'])
201+
: makeSize(iconVerticalMargin['noLabelM'])
202+
: makeSize(iconVerticalMargin['noLabel'])
192203
}
193204
/>
194205
</BaseBox>

0 commit comments

Comments
 (0)