Promact/md2

DatePicker not working properly for change detection strategy.

Opened this issue · 7 comments

Bug, feature request, or proposal:

Bug

  • DatePicker not working properly for change detection strategy.
  • Datepicker showing only today date on view ,not value from service.
  • onchange value format showing wrong. I used format ('y-MM-dd'); But value Im getting is (dd-MM-y)

Which versions of Angular, MD2, OS, browsers are affected?

Angular : 4.4.6
md2: 0.0.29
os : windows 10
Browser: Chrome 61.0.3163.10(64 BIT)

same issue :(

@ChenReuven I managed to fix temporarily by hiding md-datepickers input field and replacing it with my input field used in components. It worked.

Reason behind the issue is datepicker and input field not working properly for change detection strategy.

Thanks men i will try this solution. It means that u will have 2 inputs(one that u create and one related to datepicker) that will look at the same model/formcontrolname, right?

Yes both inputs share same ngmodel variable. And hide md2-input using opacity:0 or visibility hidden . don't use ng-if

Thanks bro, appriciate it :-) i hope that perminate fix will insert soob cause it CRITICAL bug.

Suppose the best answer right now is to wrap the date picker with custom element and use your suggestion fix

Till this issue is fixed, you can use the custom npm package I created by modifying their source code.
https://www.npmjs.com/package/abhi9-md2
You should rename the folder 'abhi9-md2' to 'md2' if you have an already setup project.

Or if you want to fix it manually, you can refer the solution I posted in #291

@hariprasanthjm @ChenReuven Could you please share the source code for your solution?.. The lib is good, but this issue is really critical and it ruins everything :(
@abhi9bakshi your fixes don't fix this btw