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

fix(list): allow for list and list items to be disabled #17584

Merged
merged 1 commit into from
Jan 24, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Nov 2, 2019

Adds the ability to disable all variants of the list. Currently it's only the selection list that can be disabled.

Fixes #17574.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Nov 2, 2019
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 2, 2019
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's the contrast ratio on disabled items?

@@ -300,6 +300,10 @@ mat-action-list {
outline: none;
}

.mat-list-item-disabled {
pointer-events: none;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also disable tooltips, I think we'd want to avoid

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would we prevent clicking on it though? We've done something similar to support disabled tabs in the tab nav bar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the tabs thing is why I thought about this (someone mentioned it in a bug). I don't know of another way to do this other than preventDefault / stopPropagation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't rely on preventDefault/stopPropagation, because we don't have a way of ensuring that our event listeners are invoked before the user's.

@crisbeto crisbeto force-pushed the 17574/list-disabled branch from 5008f3a to 1880478 Compare November 17, 2019 09:00
@crisbeto
Copy link
Member Author

Sorry for the delayed response @jelbourn, I must've missed the notification. The feedback has been addressed, can you take another look. As for the contrast ratio on disabled items, I haven't checked it but it's the same as what we have in master for selection lists.

@crisbeto crisbeto force-pushed the 17574/list-disabled branch 2 times, most recently from f776d58 to f1d52ef Compare November 24, 2019 12:34
@Ammonix
Copy link

Ammonix commented Dec 2, 2019

when will this get merged?

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I guess native controls don't show their title tooltip when disabled, so it makes sense for our stuff to do the same.

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Dec 3, 2019
@crisbeto crisbeto force-pushed the 17574/list-disabled branch from f1d52ef to b54fccb Compare January 3, 2020 15:51
Adds the ability to disable all variants of the list. Currently it's only the selection list that can be disabled.

Fixes angular#17574.
@crisbeto crisbeto force-pushed the 17574/list-disabled branch from b54fccb to a190db0 Compare January 19, 2020 12:29
@jelbourn jelbourn merged commit c6a9f15 into angular:master Jan 24, 2020
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
Adds the ability to disable all variants of the list. Currently it's only the selection list that can be disabled.

Fixes angular#17574.
@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 Feb 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mat-action-list missing disabled styles
5 participants