Request "open-on-focus" attribute on datepicker-popup.
After upgrading to 0.11 our datepicker popups no longer work as expected. I've asked around on IRC and came to the conclusion that there are very good reasons for this (w.r.t. accessibility).
Nevertheless, the guys from business prefer the old behavior. As they are the end-user, there is little I can do to convince them that the current behavior is fine.
As a compromise I propose an "open-on-focus" attribute, which could be put on datepicker-popups to re-enable the old behavior. A note should be made in the documentation to explain the accessibility issues involved.
Thank you.
+1
Can somebody please explain this good reasons?
Btw. this is working fine for me:
<input datepicker-popup is-open="focus" ng-focus="focus=true" />
+1
+1
I have an error (̀$apply already in progress) in the console with @peterslivka solution, see #2548.
Maybe I'm doing something wrong ?
I'm seeing the same error as Kevlys when using either data-ng-focus="..." or data-ng-blur="..."
One quick solution to the $apply already in progress error is to instead point the ng-focus event to a function in the controller, and then use a $timeout to set the isOpen value (in this example - focus)
On the controller:
$scope.openDate = function ($event) {
$event.preventDefault();
$event.stopPropagation();
$timeout(function() {
$scope.focus = true;
});
};
And then the element becomes:
<input datepicker-popup is-open="focus" ng-focus="openDate($event)" />
+1
+1
+1
What's the status regarding closing datepicker on blur?
+1
looks like onOpenFocus doesn't work http://plnkr.co/edit/s15jAd1hEEI94dCeC42I?p=preview
@bademux, please do not comment on old and closed issues. Doing so is a really good way for us to miss it.
If you think you've found a bug, please follow these instructions.
Unfortunately, if you think you have found a bug and do not follow the above instructions within a reasonable amount of time, we will close the issue due to lack of activity.
@icfantv Can you please re-open this?
https://github.com/angular-ui/bootstrap/commit/68afc4c63e791e86de7fe59be9bc8fb7e68243f6 should not have closed this as that adds on-open-focus and not the proposed open-on-focus as outlined in this issue. The former allows for "disabling of focus of popup after datepicker popup is opened" while the later would allow for the previous behavior on input elements (where focusing would open the popup).
Presently, the best solution is as @peterslivka said: <input datepicker-popup is-open="focus" ng-focus="focus=true" /> which is gross o_O.