Skip to content

Commit ea223e0

Browse files
authored
Merge pull request #9 from Enouvo/chore/handlers
chore[handlers]: pass onSubmit + onReset
2 parents 382ebd8 + 87261e6 commit ea223e0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@enouvo/react-modern-calendar-datepicker",
3-
"version": "4.0.3",
3+
"version": "4.0.4",
44
"description": "A modern, beautiful, customizable date picker for React",
55
"main": "lib/index.js",
66
"types": "index.d.ts",

src/DatePicker.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ const DatePicker = ({
145145
to: null,
146146
});
147147
}
148-
setCalendarVisiblity(false);
149148
onReset();
149+
setCalendarVisiblity(false);
150150
};
151151
const handleApply = () => {
152-
setCalendarVisiblity(false);
153152
onSubmit();
153+
setCalendarVisiblity(false);
154154
};
155155

156156
const renderFooterDefault = () => (
@@ -240,6 +240,8 @@ DatePicker.defaultProps = {
240240
wrapperClassName: '',
241241
locale: 'en',
242242
calendarPopperPosition: 'top',
243+
onSubmit: () => {},
244+
onReset: () => {},
243245
};
244246

245247
export default DatePicker;

0 commit comments

Comments
 (0)