-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Disable broken in 3.1.1 #493
Comments
It's not the same issue... #132 talks about calling disable function on datetimepicker which should work. You are talking about adding this property through other ways or even having the property on html code before even initializing the datepicker component. Am I correct? or do I miss something |
There are two issues here:
I have a 3 line fix locally and will prepare a PR shortly. |
I've also changed the jsfiddle to show that neither disabling nor enabling inputs through the api has any effect: http://jsfiddle.net/8Ldryg82/ |
check on development branch. It should work as expected now |
This looks pretty much exactly like my local changes :-) diff --git a/vendor/assets/javascripts/bootstrap-datetimepicker.js b/vendor/assets/javascripts/bootstrap-datetimepicker.js
index 91845d7..fad266c 100644
--- a/vendor/assets/javascripts/bootstrap-datetimepicker.js
+++ b/vendor/assets/javascripts/bootstrap-datetimepicker.js
@@ -1182,6 +1182,9 @@ THE SOFTWARE.
};
picker.show = function (e) {
+ if (getPickerInput().prop('disabled')) {
+ return;
+ }
if (picker.options.useCurrent) {
if (getPickerInput().val() === '') {
if (picker.options.minuteStepping !== 1) {
@@ -1220,7 +1223,7 @@ THE SOFTWARE.
};
picker.disable = function () {
- var input = picker.element.find('input');
+ var input = getPickerInput();
if (input.prop('disabled')) {
return;
}
@@ -1229,7 +1232,7 @@ THE SOFTWARE.
};
picker.enable = function () {
- var input = picker.element.find('input');
+ var input = getPickerInput();
if (!input.prop('disabled')) {
return;
} I'll try your version. |
there was a problem in the init as well attaching event handlers even when disabled. Anyway try it and let me know if that fixes the issue. |
It's working fine now, thank you! |
Can I close the issue, or do you wan't to wait for the release? |
Lets leave it open as I have to check on v4beta that it works as its supposed to. I 'll close it. Thanks |
… with commented out old code, fixed #493 as well
ok fixed in v4beta as well |
The datepicker does not automatically disable, if an input group is used and the input is in state disabled. See the following jsfiddle: http://jsfiddle.net/wzbhcjk5/
Expected Behavior: Clicking on Input-group-addon should do nothing.
Actual Behavior: Can open datepicker and select dates.
Input without icon is not affected.
It seems this was broken before, see #132.
The text was updated successfully, but these errors were encountered: