-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Selected day "toggles" even though multidate is false #816
Comments
Quick fix seems to be changing behaviour of _toggle_multidate -method at line 1015: _toggle_multidate: function(date){
var ix = this.dates.contains(date);
if (!date){
this.dates.clear();
}
else if (ix == -1){
this.dates.push(date);
}
else if ((typeof this.o.multidate === 'number' && this.o.multidate > 1) || this.o.multidate === true){
this.dates.remove(ix);
}
if (typeof this.o.multidate === 'number')
while (this.dates.length > this.o.multidate)
this.dates.remove(0);
}, |
When selecting already selected day (and multidate: false), it toggles it off and clears the input field. This can be very confusing especially if using autoclose feature.
This seems to already be discussed in #775 @eternicode says that a feature will be implemented in a coming release, which prevents the date from being deselected. In the meantime, I've implemented a quick workaround: In the defaults @ line 1394, add a new option, allowDeselection
In the _toggle_multidate function @ line 1015, modify the "else if (ix !== -1)" statement to:
|
@kimbo6365 this works perfectly! PLEASE MERGE THAT FIX!! |
@kimbo6365 It works like a charm. I hope it can be merged. 👍 |
@kimbo6365 It's working! |
can anyone change this to the gitub repository so that it can be used with bower . Thanks in advance!! |
This issue should be merged with #873 as they relate to the same thing and two different PRs exist. |
Works perfectly. Please merge this. |
@kimbo6365 Outstanding, I hope this is merged ! 👍 |
OSM! I was in trouble how I will achieve this without disturbing your code! |
Fixed in #843 |
When selecting already selected day (and multidate: false), it toggles it off and clears the input field. This can be very confusing especially if using autoclose feature.
The text was updated successfully, but these errors were encountered: