bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

datepicker-popup stopped working in UI Bootstrap 0.11.0

Open ngtrimble opened this issue 12 years ago • 30 comments

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 avatar May 05 '14 20:05 ngtrimble

@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.

bekos avatar May 05 '14 20:05 bekos

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

avp avatar May 20 '14 23:05 avp

+1. I've the same error when I add ng-focus="dt.open = true" and click on a date in the popup.

boillodmanuel avatar May 26 '14 16:05 boillodmanuel

+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.

OlmoAcerta avatar Jun 10 '14 13:06 OlmoAcerta

@bekos It's not mentioned anywhere in the changelog, which is why people are creating issues for this.

timdorr avatar Jul 01 '14 12:07 timdorr

^^agreed

unsalted avatar Jul 04 '14 13:07 unsalted

@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 avatar Jul 07 '14 07:07 OlmoAcerta

@OlmoAcerta Using ng-click won't make it work when you tab into the field, which is what I would really like.

avp avatar Jul 07 '14 15:07 avp

Can we please have the "focus" functionality put back in?

scottkilker avatar Jul 18 '14 16:07 scottkilker

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?

cornel-masson avatar Jul 30 '14 16:07 cornel-masson

+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?

Rayton avatar Jul 31 '14 12:07 Rayton

+1 cornel-masson and rayton.

drewtunney avatar Aug 11 '14 18:08 drewtunney

Any update on this? This is affecting the project that I'm working on.

sagar-ganatra avatar Aug 21 '14 06:08 sagar-ganatra

+1 sagar-ganatra on this too. Any update on this? I can't upgrade to .11 until this is fixed.

kinstephen avatar Aug 28 '14 01:08 kinstephen

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.

ghost avatar Sep 05 '14 14:09 ghost

@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

gonzoyumo avatar Sep 08 '14 09:09 gonzoyumo

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 avatar Sep 11 '14 03:09 cassioam

@cassioam that's ok for click, but we still miss focus trigger :(

gonzoyumo avatar Sep 11 '14 07:09 gonzoyumo

@gonzoyumo ah, my bad.

cassioam avatar Sep 11 '14 12:09 cassioam

+1

aaronkaka avatar Sep 15 '14 19:09 aaronkaka