Skip to content

Recreating FormGroup with disabled attribute has different effect on matSelect vs matInput #17860

Closed

Description

@kyletanders

Reproduction

Use StackBlitz to reproduce your issue:
https://stackblitz.com/edit/components-issue-qr6rcq

Steps to reproduce:

  1. Click Recreate Form button
  2. Notice that the input is disabled but the mat-select is not

Also just for comparison see that calling formControl.disable() does work as expected:
3. Reload the page
4. Click 'Disable Function' button
5. Notice both input and select are disabled as expected

Expected Behavior

What behavior were you expecting to see?
Expected matSelect and matInput to both be disabled when creating a new FormGroup where the disabled value was set to true for both of them.

Actual Behavior

What behavior did you actually see?
Only the matInput was disabled

Environment

  • Angular: 8.0.0
  • CDK/Material: 8.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Activity

  1. self-assigned this
    on Dec 4, 2019
  2. added
    P3
    on Dec 4, 2019
  3. added a commit that references this issue on Dec 4, 2019
    02e1c57
  4. Skfsh commented on Dec 18, 2019

    @Skfsh

    Actually this issue applies to other controls as well.

    https://stackblitz.com/edit/angular-8-material-starter-template-szedxq?file=src%2Fapp%2Fapp.component.html

    Only Input, datepicker and autocomplete work as expected.

  5. crisbeto commented on Dec 18, 2019

    @crisbeto
    Member

    This came up in #17985.

  6. kyletanders commented on Feb 26, 2020

    @kyletanders
    Author

    Quick note on this... it appears the datepicker has a similar issue. The input itself seems to be disabled, but the icon that triggers the datepicker is still enabled and allows you to select a date. See demo from Skfsh: https://stackblitz.com/edit/angular-8-material-starter-template-szedxq?file=src%2Fapp%2Fapp.component.html

  7. added a commit that references this issue on Aug 21, 2020
    cf377fe
  8. added a commit that references this issue on Nov 26, 2020
    a1fffb5
  9. added a commit that references this issue on Dec 6, 2020
    46a247d
  10. added a commit that references this issue on Jan 7, 2021
    ef20461
  11. added 2 commits that reference this issue on Mar 3, 2022
    7a9b1dc
    e921ebf
  12. added 2 commits that reference this issue on Mar 3, 2022
    723a821
    d22d73a
  13. angular-automatic-lock-bot commented on Apr 3, 2022

    @angular-automatic-lock-bot

    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.

  14. locked and limited conversation to collaborators on Apr 3, 2022
  15. added a commit that references this issue on Apr 3, 2022
    3dd076c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3area: material/inputarea: material/select

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions