angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.33k stars 6.73k forks source link

Bug Datepicker: disabled attribute doesn't work with Reactive Forms #12065

Closed Bielik20 closed 6 years ago

Bielik20 commented 6 years ago

Bug

What is the expected behavior?

It should work just like in example -> Disabled datepicker -> Input disabled (the third one)

What is the current behavior?

When using reactive forms it isn't disabled and we receive this message: image

While I understand purpose of this message, setting disabled in form control prevents any changes to that field. I want only manual input to be disabled due to https://github.com/angular/material2/issues/11936 and https://github.com/angular/material2/issues/12064.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-datepicker-disable-bug

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

crisbeto commented 6 years ago

This message is being logged by @angular/forms, not Material. You can post an issue about it on the main repo.

Bielik20 commented 6 years ago

Moved here: https://github.com/angular/angular/issues/24941

LoganDupont commented 5 years ago

@Bielik20 Did you found a solution for this problem?

Bielik20 commented 5 years ago

@LoganDupont Hi, unfortunately no. After moving it to main angular repo I stopped tracking it. The related issue seams to be closed so I guess they found 'a' solution.

LoganDupont commented 5 years ago

@Bielik20 Well the issues linked to it seems to focus on how to solve the message and not the problem of disabling the formControl, which solves the message, also results in disabling all parts of the datepicker.

Bielik20 commented 5 years ago

Well, maybe it is a good idea to ping one of the collaborators there on my issue to inform them that it is in fact not resolved. Maybe they will reopen it.

W dniu wt., 22.01.2019 o 17:34 Logan Dupont notifications@github.com napisał(a):

@Bielik20 https://github.com/Bielik20 Well the issues linked to it seems to focus on how to solve the message and not the problem of disabling the formControl, which solves the message, also results in disabling all parts of the datepicker.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/material2/issues/12065#issuecomment-456467045, or mute the thread https://github.com/notifications/unsubscribe-auth/AM0FOmZwVliZVeduuEdmosky0FBEq-Niks5vFz2jgaJpZM4VC2-M .

brgrz commented 5 years ago

@crisbeto This really shouldn't been closed. As it currently stands it is impossible to have disabled input but enabled datepicker popup with inputs bounds to reactive form controls. This should've been addressed here, it is not a Angular Forms issue.

For others: there is a partial solution to this and it involves setting the readonly attribute however that changes the styling of the control.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.