Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Request "open-on-focus" attribute on datepicker-popup. #2303

Closed
OlmoAcerta opened this issue Jun 6, 2014 · 15 comments
Closed

Request "open-on-focus" attribute on datepicker-popup. #2303

OlmoAcerta opened this issue Jun 6, 2014 · 15 comments

Comments

@OlmoAcerta
Copy link

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.

@JustMaier
Copy link

+1

@svestka
Copy link

svestka commented Jun 25, 2014

Can somebody please explain this good reasons?

Btw. this is working fine for me:

<input datepicker-popup is-open="focus" ng-focus="focus=true" />

@clicktravel-martin
Copy link

+1

1 similar comment
@Kevlys
Copy link

Kevlys commented Aug 5, 2014

+1

@Kevlys
Copy link

Kevlys commented Aug 6, 2014

I have an error (̀$apply already in progress) in the console with @peterslivka solution, see #2548.

Maybe I'm doing something wrong ?

@samuelms1
Copy link

I'm seeing the same error as Kevlys when using either data-ng-focus="..." or data-ng-blur="..."

@mgoodfellow
Copy link

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)" />

@jwanglof
Copy link

jwanglof commented Apr 7, 2015

+1

@arjunasuresh3
Copy link

+1

1 similar comment
@artdias90
Copy link

+1

@artdias90
Copy link

What's the status regarding closing datepicker on blur?

@sistemanick
Copy link

+1

@bademux
Copy link

bademux commented Oct 22, 2015

looks like onOpenFocus doesn't work http://plnkr.co/edit/s15jAd1hEEI94dCeC42I?p=preview

@icfantv
Copy link
Contributor

icfantv commented Oct 22, 2015

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

@WesleyKapow
Copy link

@icfantv Can you please re-open this?

68afc4c 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests