valor-software / ngx-bootstrap

Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
https://valor-software.com/ngx-bootstrap
MIT License
5.53k stars 1.69k forks source link

datepicker input is always dirty when ngModel is a non-null value #3014

Closed JimJafar closed 6 years ago

JimJafar commented 6 years ago

Bug description or feature request:

The datepicker component has the isDirty flag set shortly after being loaded when ngModel is not null.

Plunkr

https://plnkr.co/edit/odlMZcGA7WzuO75TSeCD?p=preview

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: 1.9.3

Angular: 4.3.2

Bootstrap: bootstrap-sass 3.3.7

Build system: Angular CLI, System.js, webpack, starter seed:

Webpack yo angular2-typescript generator version 0.8.1.

mrajaraman commented 6 years ago

We also have the same issue. May I know when it will get fixed?

JimJafar commented 6 years ago

This is actually a big problem - it's breaking form validation. Can I help with fixing it if you guys are too busy?

IlyaSurmay commented 6 years ago

Sure, that would be awesome :)

valorkin commented 6 years ago

ok, seems I have fixed it, testing

JimJafar commented 6 years ago

Excellent news, thanks @valorkin ! Sorry - we are in crunch time so I didn't get a chance to look at it.

valorkin commented 6 years ago

Will be published this thusday, but you can check here http://ngx-bootstrap.surge.sh/#/datepicker

JimJafar commented 6 years ago

Hi @valorkin Will you be publishing a new release with this fix? I'm not trying to rush you - just checking so we can set our release timeline :)

valorkin commented 6 years ago

I was planning to do release yestarday, but QA took couple of dayoffs, so she will test it on Monday, and I will be able to release it

JimJafar commented 6 years ago

Fantastic, thank you!

chanakyanet commented 6 years ago

@valorkin Error on edit the form, cancel submission with form reset. display new form, then it displays calendar input as invalid and dirty, but html text boxes seem to work fine. except that calendar box

valorkin commented 6 years ago

@chanakyanet could you provide a sample please?

chanakyanet commented 6 years ago

@valorkin could not complete the plunk looks like there is some unknown issue, could you please help me run the below. https://plnkr.co/edit/E64y9HUKdiAHrp1Q79hm?p=preview so i could work it out.

mfrieman commented 6 years ago

Was this fix ever released because I'm having the same issue.

kobayakid commented 5 years ago

i came across this issue and a possible workaround may be calling markAsPristine() and markAsUntouched() form methods after setting the null value. it might work on some cases.