Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datepicker input doesn't get touched and ng-touched properties when choosing a date #918

Closed
llekn opened this issue Oct 19, 2016 · 4 comments

Comments

@llekn
Copy link
Contributor

llekn commented Oct 19, 2016

Bug description:

When choosing a date on an input with the ngbDatepicker directive on a Reactive Form the corresponding FormControl doesn't get the touched property set to true nor the input field get the ng-touched class.

Link to minimally-working plunker that reproduces the issue: http://plnkr.co/edit/ulNJTzkjIbAZxdVmSCsx?p=preview

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 2.0.2

ng-bootstrap: 1.0.0-alpha.8

Bootstrap: 4.0.0-alpha.4

@pkozlowski-opensource
Copy link
Member

@llekn yup, we are not propagating this info to a control, sadly. It is a bug. The good news is that is should be very easy to fix. The only "real" work in this case will be in writing tests :-) Would you be up to sending a PR?

@llekn
Copy link
Contributor Author

llekn commented Oct 19, 2016

Hi @pkozlowski-opensource Yes, I've already have a proposed fix and now I'm falling down on the testing rabbit hole.

As soon as I get the test working will send the PR!

@pkozlowski-opensource
Copy link
Member

As soon as I get the test working will send the PR!

Awesome! I hope you will manage with tests looking at the existing ones. It shouldn't be too difficult, but feel free to ping us if you hit roadblocks.

@llekn
Copy link
Contributor Author

llekn commented Oct 19, 2016

Hey @pkozlowski-opensource ! I was able to add a test for change of ng-touched on input blur, but I'm struggling to build a test for ng-touched when a date is entered using the datepicker.

Any idea?

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

No branches or pull requests

2 participants