md2 icon indicating copy to clipboard operation
md2 copied to clipboard

DatePicker not working properly for change detection strategy.

Open hariprasanthjm opened this issue 7 years ago • 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)

hariprasanthjm avatar Nov 07 '17 04:11 hariprasanthjm

same issue :(

ChenReuven avatar Nov 27 '17 16:11 ChenReuven

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

hariprasanthjm avatar Nov 28 '17 06:11 hariprasanthjm

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?

ChenReuven avatar Nov 28 '17 06:11 ChenReuven

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

hariprasanthjm avatar Nov 28 '17 06:11 hariprasanthjm

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

ChenReuven avatar Nov 28 '17 06:11 ChenReuven

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 https://github.com/Promact/md2/issues/291

abhi9bakshi avatar Dec 07 '17 20:12 abhi9bakshi

@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

haskelcurry avatar Jan 28 '18 14:01 haskelcurry