Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatSelectionList disabled input is only checked at creation time #9952

Closed
amandabot opened this issue Feb 14, 2018 · 3 comments · Fixed by #9963 or #11955
Closed

MatSelectionList disabled input is only checked at creation time #9952

amandabot opened this issue Feb 14, 2018 · 3 comments · Fixed by #9963 or #11955
Assignees
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@amandabot
Copy link

Bug, feature request, or proposal:

MatSelectionList's disabled input does not update child list option styles if it is changed.

What is the expected behavior?

Changing the disabled input should update the appearance of the list's items.

What is the current behavior?

List items retain their style.

What are the steps to reproduce?

https://stackblitz.com/edit/angular-x4tdc2

  1. Select any item from the list
  2. Click the button to toggle the disabled state of the selection list
  3. Observe the styles of each item; they remain active
  4. Click any item; the style toggles to the expected disabled style
  5. Click the button to toggle the disabled state of the selection list
  6. Click any item; the style toggles to the expected enabled style

What is the use-case or motivation for changing an existing behavior?

It's not clear whether disabled is meant to be a one-time setting or if it is meant to be dynamic. In the former case, the docs should be more clear about it; if it's the latter, the component does not behave as expected

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

Angular 5.2.3
Material 5.2.0
TypeScript 2.6.2

Is there anything else we should know?

@devversion devversion self-assigned this Feb 14, 2018
devversion added a commit to devversion/material2 that referenced this issue Feb 15, 2018
* Currently if a list option is disabled through the `[disabled]` binding, the disabled option still has the `pointer` cursor.
* Fixes that list options are still focusable if disabled.
* Fixes that the selection list is still focusable if disabled.

Fixes angular#9952
devversion added a commit to devversion/material2 that referenced this issue Feb 17, 2018
* Currently if a list option is disabled through the `[disabled]` binding, the disabled option still has the `pointer` cursor.

* No longer delegates the keydown event to the ListKeyManager when disabled. Right now there can be an exception because all items are disabled. See angular#9981.

Fixes angular#9952.
jelbourn pushed a commit that referenced this issue Feb 18, 2018
* Currently if a list option is disabled through the `[disabled]` binding, the disabled option still has the `pointer` cursor.
* No longer delegates the keydown event to the ListKeyManager when disabled. Right now there can be an exception because all items are disabled. See #9981.

Fixes #9952.
tinayuangao pushed a commit that referenced this issue Feb 20, 2018
* Currently if a list option is disabled through the `[disabled]` binding, the disabled option still has the `pointer` cursor.
* No longer delegates the keydown event to the ListKeyManager when disabled. Right now there can be an exception because all items are disabled. See #9981.

Fixes #9952.
andrewseguin pushed a commit that referenced this issue Feb 20, 2018
* Currently if a list option is disabled through the `[disabled]` binding, the disabled option still has the `pointer` cursor.
* No longer delegates the keydown event to the ListKeyManager when disabled. Right now there can be an exception because all items are disabled. See #9981.

Fixes #9952.
@amandabot
Copy link
Author

I think this issue should be reopened as it hasn't been fully resolved with 5.2.2.

https://stackblitz.com/edit/angular-x4tdc2

If I select items from the list, then set the MatSelectionList disabled to true, those items are not styled as disabled:

image

Is disabled meant to be a one-time binding, or am I using it incorrectly in the example?

@devversion devversion reopened this Feb 22, 2018
@devversion
Copy link
Member

I agree, although it's not even released in 5.2.2, but in 6.0.0-beta.2. It's only partly resolved now. The list items can be still focused because I didn't address the tabIndex issue yet.

The runtime exceptions when using the list key manager are solved. though.

Related issue that should also fix the remaining parts of this issue: #9995

@devversion devversion added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed has pr labels Feb 22, 2018
devversion added a commit to devversion/material2 that referenced this issue Jun 27, 2018
* Fixes that dynamically changing the `[disabled]` binding does not update the state of the list options (e.g. ripple disabled state; checkbox disabled styling)

Fixes angular#9952
devversion added a commit to devversion/material2 that referenced this issue Jun 28, 2018
* Fixes that dynamically changing the `[disabled]` binding does not update the state of the list options (e.g. ripple disabled state; checkbox disabled styling)

Fixes angular#9952
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
2 participants