Skip to content

Commit 1a61c7d

Browse files
committed
Fix bug
1 parent 6c9dcbf commit 1a61c7d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Got ideas on how to make this better? Open an issue!
116116

117117
## Thanks to
118118
- [Litepie Datepicker](https://litepie.com/)
119+
- [Vue Tailwind Datepicker](https://vue-tailwind-datepicker.com/)
119120
- [React](https://reactjs.org/)
120121
- [Tailwind CSS](https://tailwindcss.com/)
121122
- [dayjs](https://day.js.org/)

src/components/Shortcuts.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {Period} from "../types";
55
import DatepickerContext from "../contexts/DatepickerContext";
66

77
const ItemTemplate = React.memo((props: any) => {
8-
const {primaryColor, period, changePeriod, changeInputText, updateFirstDate, dayHover, changeDayHover} = useContext(DatepickerContext);
8+
const {primaryColor, period, changePeriod, changeInputText, updateFirstDate, dayHover, changeDayHover, hideDatepicker} = useContext(DatepickerContext);
99

1010
// Functions
1111
const getClassName: () => string = useCallback(() => {
@@ -26,8 +26,9 @@ const ItemTemplate = React.memo((props: any) => {
2626
}
2727
changeInputText(`${item.start} ~ ${item.end}`);
2828
changePeriod(item);
29-
updateFirstDate(dayjs(item.start))
30-
}, [changeDayHover, changeInputText, changePeriod, dayHover, period.end, period.start, updateFirstDate]);
29+
updateFirstDate(dayjs(item.start));
30+
hideDatepicker()
31+
}, [changeDayHover, changeInputText, changePeriod, dayHover, period.end, period.start, updateFirstDate, hideDatepicker]);
3132

3233
return (
3334
<li

0 commit comments

Comments
 (0)