Promact / md2

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.
http://code.promactinfo.com/md2/
MIT License
379 stars 111 forks source link

DatePicker not working properly for change detection strategy. #295

Open hariprasanthjm opened 7 years ago

hariprasanthjm commented 7 years ago

Bug, feature request, or proposal:

Bug

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)

ChenReuven commented 7 years ago

same issue :(

hariprasanthjm commented 7 years ago

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

ChenReuven commented 7 years ago

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?

hariprasanthjm commented 7 years ago

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

ChenReuven commented 7 years ago

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

abhi9bakshi commented 6 years ago

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

haskelcurry commented 6 years ago

@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