-
Notifications
You must be signed in to change notification settings - Fork 6.7k
datepicker-popup stopped working in UI Bootstrap 0.11.0 #2149
Comments
@ngtrimble You could read about removing the "open on focus" in the changelog, but you can also read my comment for the rationale of the decision and find a workaround if you still want to have this functionality. |
If I use
|
+1. |
+1 We're also (intermittently) seeing the "$apply already in progress" error when we use the ng-focus fix. A possible solution might be to to set the is-open attribute using a setTimeout, but I haven't tried it. We've decided (internally) to create a wrapper around datepicker which includes a "select date" button that opens the calendar. |
@bekos It's not mentioned anywhere in the changelog, which is why people are creating issues for this. |
^^agreed |
@avp @boillodmanuel FWIW we were able to solve the errors by using ng-click instead of ng-focus. Unfortunately, due to the way manual date input works with the picker, we were asked to replace it by a jquery timepicker (https://github.com/Eonasdan/bootstrap-datetimepicker). Luckily this was after having created the wrapper, so it was a reasonably quick fix. |
@OlmoAcerta Using ng-click won't make it work when you tab into the field, which is what I would really like. |
Can we please have the "focus" functionality put back in? |
Huh? I have a standard date-picker which works in 0.10.0, but doesn't in 0.11.0. What's going on? My picker is declared with one attribute: <input ... datepicker-popup="dd/MM/yyyy"...> which, in 0.10.0, brought up the picker if I click in the input field, but now it does nothing. How can this possibly be acceptable behaviour? |
+1 have the same problem as the cornel-masson. |
+1 cornel-masson and rayton. |
Any update on this? This is affecting the project that I'm working on. |
+1 sagar-ganatra on this too. Any update on this? I can't upgrade to .11 until this is fixed. |
Same "$apply already in progress" problem with the new is-open="isOpen" ng-focus="isOpen = true" approach, we upgraded from 0.9 a while back adjusted the project to suit, so discarding 0.11 not easy. Have tried all sorts of things. Is there a fix or hack? Can't find a solution unfortunately and we don't want to use a different datepicker library or different looking datepicker. |
I found a work around:
|
@cassioam that's ok for click, but we still miss focus trigger :( |
@gonzoyumo ah, my bad. |
+1 |
+1, the ng-focus work around produces an $apply error that should probably be fixed |
I've created the separate issue #2789, because so many people seem affected by this problem. |
It's simple, element[0].focus() on date selection triggers 'change' or some other event which then executes a digest |
+1 @timdorr This needs to be in the change log - has been driving me crazy for days. Any news on fixes? |
@Igosuki Is there a work-around? |
Finally fixed: pedroxs@31e283d |
@OlmoAcerta unfortunately nothing, patch the lib or rewrite it internally and make sure it's included in the right order. |
Not sure if this solution would work for those who are still having issues with ng-focus and apply errors after selection. Just use the old focus work around by implementing a custom focus directive which checks if digest or apply is in progress. .directive('fixFocus', ['$parse', function ($parse) {
return function (scope, element, attr) {
var fn = $parse(attr['fixFocus']);
element.bind('focus', function (event) {
if (!scope.$$phase) {
scope.$apply(function () {
fn(scope, { $event: event });
});
}
else {
fn(scope, { $event: event });
}
});
}
}]) <input name="Value" type="text" ng-model="entityDate.Value" is-open="dt.opened" fix-focus="dt.opened = true" datepicker-popup="MM/dd/yyyy" /> |
Could the popup functionality be made as a configurable option similar to showWeeks in a future release? Specifically regarding when a date field is clicked in or focused on? |
datepicker-popup functionality not working and not getting any errors |
I am having an issue with UI Bootstrap 0.11.0. My datepicker-popup was working fine in 0.10.0. It is a simple that when the user clicks in it the datepicker appears.
In UI Bootstrap 0.11.0 the datepicker just does not popup any more. The problem can be reproduced at http://plnkr.co/edit/3fxVbuTxlTetNvQW4JeZ?p=preview. Just comment the 0.10.0 URL and uncomment the 0.11.0 URL.
Please let me know if I can provide anymore details. Thanks.
The text was updated successfully, but these errors were encountered: