-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Close DatePicker Modal, by a button or after selecting date #113
Comments
I couldn't close it either, so I did it by clicking its input, which involves DOM manipulation and is not considered best practice: // in Component.tsx
const toggleModal = useCallback(() => {
const dateInput: HTMLInputElement | null = wrapperRef.current?.querySelector(`.${dateInputClassName}`) ?? null;
dateInput?.click();
}, []);
This can be called in <DatePicker
inputClass={dateInputClassName}
onChange={() => toggleModal()}
/> |
There are two ways you can achieve it. The calendar will be closed when the user clicks outside the date picker, however, you can also pass the |
show prop not work |
I have the same issue |
H @rzkhosroshahi |
I might change the |
i have same issue and handle it with this code function simulateClick(x, y) {
} its not best way but there is no ohter way. |
Hey, as it's on the title:
How do you close DatePicker Modal by using a button or after the user selects its desired date?
package.json:
"...",
"react": "18.2.0",
"next": "13.4.12",
"zaman": "^2.0.7"
The text was updated successfully, but these errors were encountered: