Skip to content

Commit 2697086

Browse files
authored
Merge pull request #8 from Toprent-app/feat/add-datepicker-z-index-to-props
Feat: add datepicker z index to props
2 parents a15cfb3 + e287dcb commit 2697086

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

packages/styled/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@power-rent/react-datepicker-modern",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "A React datepicker build with styled-components.",
55
"keywords": [
66
"datepicker",

packages/styled/src/components/DateRangeInputModern/DateRangeInputModern.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ export interface DateRangeInputModernProps extends UseDatepickerProps {
114114
datepickerHeightCustom?: string
115115
datepickerLeftCustom?: string
116116
datepickerTopCustom?: string
117+
datepickerZIndexCustom?: number | null
117118
}
118119

119120
function DateRangeInputModern({
@@ -156,6 +157,7 @@ function DateRangeInputModern({
156157
datepickerHeightCustom,
157158
datepickerLeftCustom,
158159
datepickerTopCustom,
160+
datepickerZIndexCustom,
159161
}: DateRangeInputModernProps) {
160162
const ref = useRef(null)
161163
const datepickerWrapperRef = useRef<HTMLDivElement>(null)
@@ -304,6 +306,7 @@ function DateRangeInputModern({
304306
datepickerBorderRadius={datepickerBorderRadiusCustom}
305307
datepickerWidth={datepickerWidthCustom}
306308
datepickerHeight={datepickerHeightCustom}
309+
datepickerZIndex={datepickerZIndexCustom}
307310
/>
308311
)}
309312
</Box>

packages/styled/src/components/Datepicker/Datepicker.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export interface DatepickerProps extends UseDatepickerProps {
153153
datepickerHeight?: string
154154
datepickerLeft?: string
155155
datepickerTop?: string
156+
datepickerZIndex?: number | null
156157
}
157158

158159
function Datepicker(
@@ -188,6 +189,7 @@ function Datepicker(
188189
datepickerHeight = 'unset',
189190
datepickerLeft = '0px',
190191
datepickerTop = '0px',
192+
datepickerZIndex = null,
191193
}: DatepickerProps,
192194
ref?: React.Ref<unknown>,
193195
) {
@@ -315,7 +317,7 @@ function Datepicker(
315317
boxShadow={theme.datepickerBoxShadow}
316318
width={theme.datepickerWidth}
317319
height={datepickerHeight}
318-
zIndex={theme.datepickerZIndex}
320+
zIndex={datepickerZIndex || theme.datepickerZIndex}
319321
rtl={rtl}
320322
left={datepickerLeft}
321323
top={datepickerTop}

0 commit comments

Comments
 (0)