datepicker-popup stopped working in UI Bootstrap 0.11.0
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.
@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 ng-focus, when I click on a date in the datepicker, I get the error:
Plunk example throws JS error:
Error: [$rootScope:inprog] $apply already in progress
errors.angularjs.org/1.2.16/$rootScope/inprog?p0=%24apply at
code.angularjs.org/1.2.16/angular.js:78:12 ...
See http://plnkr.co/edit/ct46CK6NRb9FWdpzfQpI?p=preview
+1.
I've the same error when I add ng-focus="dt.open = true" and click on a date in the popup.
+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. Also it could be nice if the datepicker should re-size and position according to the DOM like that in jqueryUI datepicker and bootstrap datepicker. Can this feature be added or just create a directive to include jqueryUI datepicker?
+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.
@bekos, I was also a bit lost about that change as it's not mentioned at all in the Changelog. Please find according PR here : #2675
I found a work around:
<input type="text" class="form-control" datepicker-popup="yyyy/MM/dd" ng-model="myDate" is-open="data.isOpen" ng-click="data.isOpen=true" datepicker-options="myDateOptions" ng-required="true" close-text="Close" />
@cassioam that's ok for click, but we still miss focus trigger :(
@gonzoyumo ah, my bad.
+1