Comments (7)
And that's an issue, will fix it in the next update!
Thank you for opening this issue!
from mcdatepicker.
Hey,
it was intentionally designed to act like that, let me explain to you why:
There are 4 main hooks that are linked to 4 specific events or actions:
-
onOpen()
hook - this hook is linked to the custom open event so every time the calendar appears (when using theopen()
method or by clicking on the linked input field) the calendar pops up and then theonOpen()
hook does its job, -
onClose()
hook - think of it as an opposite ofonOpen()
hook, the provided callback is executed every time the calendar disappears (that may be caused by using theclose()
method or by clickingCancel
orOK
button) -
onSelect()
hook - the provided callback is executed only when theOK
button is clicked, -
onCancel()
hook - the provided callback is executed only when theCancel
button is clicked.
Check out this example: https://jsfiddle.net/mike_cojocari/gmzfphx9/12/
You will notice that when you click on the Open
button the onOpen()
hook executes its callback, if you will click on the calendar OK
button, the onSelect()
hook does its job and after that onClose()
hook executes its callback because the calendar disappears.
Same for calendar Cancel
button: onCancel()
hook executes its callback because you're clicking on it and after that onClose()
callback because the calendar disappears.
You may be wondering, in which case only the onClose()
hook is activated?
It's simple, when the calendar disappears but none of the calendar buttons were clicked, for example when using the close()
method.
from mcdatepicker.
Thanks for the explanation, but the onClose hook is executed before the onCancel hook. Is this correct?
from mcdatepicker.
Perfect - me and my team were confused and had yet not way to figure out, if it was closed regularly or by cancel button :)
Thank you Mike, we really appreciate your work 👍
from mcdatepicker.
I "minified" the b7f64a6 via webpack (nice tool!) and it solves the issue :) great work!
from mcdatepicker.
Perfect, thank you!!
from mcdatepicker.
Hey, this issue is fixed in the new version,
and it can be closed!
from mcdatepicker.
Related Issues (20)
- disableDates update, bodyType fixed? HOT 2
- You may need an appropriate loader to handle this file type HOT 1
- BUG - When selecting a two digit year (i.e. 70) the calendar jumps to 1970 HOT 2
- Problem with disableDates
- Awesome Datepicker HOT 1
- And Time ? HOT 1
- Pop-Up Blockers Cause Issues
- Help on display select date in DIV on Modal HOT 6
- customWeekDays not work HOT 7
- Behind the Modal HOT 2
- Use "customWeekDays" for Chinese week days.
- Select multiple field ids
- Could not find a declaration file for module 'mc-datepicker'.
- set full date not work. HOT 1
- Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0
- Not able to use Date picker on two inputs HOT 1
- minDate weird behaviour HOT 2
- Question
- Navigation is broken on Safari HOT 1
- Live demo
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcdatepicker.