Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit cc7a2d5

Browse files
committed
update dep version
1 parent 88ff4ba commit cc7a2d5

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

Diff for: README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,13 @@ document.querySelector('jb-date-input').setMonthList('GREGORIAN',['1','2','3','4
229229
## overflow handler
230230

231231
sometimes you place date input inside modal or end of the pages so when user open the input picker it overflow the page and some part of picker will be invisible.
232-
to fix this we add a feature called `overflowHandler` by set this to `JUMP` the picker will move, on mouse enter it's territory so user can easily pick date
232+
to fix this we add a feature called `overflowHandler` by set this to `SLIDE` the picker will move, on mouse enter it's territory so user can easily pick date
233233
```jsx
234-
<JBDateInput overflowHandler="JUMP" />
234+
<JBDateInput overflowHandler="SLIDE" />
235+
//if you want to check your overflow base on another dom and not window for example when you put date input in a modal
236+
<div ref={ref} style={{ height: "12rem", border: "solid 1px #666", overflow:"hidden" }}>
237+
<JBDateInput {...args} overflowRef={ref} />
238+
</div>
235239
```
236240

237241
### set custom style

Diff for: lib/JBDateInput.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export type JBDateInputProps = {
4848
placeholder?: string | null | undefined,
4949
jalaliMonthList?: string[] | null | undefined,
5050
gregorianMonthList?: string[] | null | undefined,
51-
overflowHandler?:"NONE" | "JUMP"
51+
overflowHandler?:"NONE" | "SLIDE",
52+
overflowRef?:React.RefObject<HTMLElement> | null,
5253
children?: React.ReactNode | React.ReactNode[],
5354
}
5455

@@ -141,9 +142,14 @@ export const JBDateInput = React.forwardRef((props: JBDateInputProps, ref) => {
141142
}, [props.placeholder]);
142143
useEffect(() => {
143144
if (element.current && props.overflowHandler !== undefined) {
144-
element.current.overflowHandler = props.overflowHandler;
145+
element.current.elements.popover.overflowHandler = props.overflowHandler;
145146
}
146147
}, [props.overflowHandler]);
148+
useEffect(() => {
149+
if (element.current && props.overflowRef !== undefined) {
150+
element.current.elements.popover.overflowDom = props.overflowRef.current;
151+
}
152+
}, [props.overflowRef]);
147153
useEffect(() => {
148154
if (element.current) {
149155
if (typeof props.style == "string") {

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react component",
2020
"react"
2121
],
22-
"version": "3.0.0",
22+
"version": "5.0.0-beta.0",
2323
"bugs": "https://github.com/javadbat/jb-date-input-react/issues",
2424
"license": "MIT",
2525
"files": [
@@ -37,6 +37,6 @@
3737
"url": "https://github.com/javadbat/jb-date-input-react"
3838
},
3939
"dependencies": {
40-
"jb-date-input": ">=4.0.0"
40+
"jb-date-input": ">=5.0.0-beta.0"
4141
}
4242
}

0 commit comments

Comments
 (0)