From 16480d0e5d1c24f24ef143f8401192e6fa7e2c52 Mon Sep 17 00:00:00 2001 From: Elizabeth Mitchell Date: Tue, 3 Oct 2023 14:43:11 -0700 Subject: [PATCH] fix(list): show pointer cursor for button list items Fixes #5045 PiperOrigin-RevId: 570501994 --- list/internal/listitem/_list-item.scss | 5 +++++ list/internal/listitem/list-item.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/list/internal/listitem/_list-item.scss b/list/internal/listitem/_list-item.scss index 58bcbdc6cc..553a773d2a 100644 --- a/list/internal/listitem/_list-item.scss +++ b/list/internal/listitem/_list-item.scss @@ -48,6 +48,10 @@ ); } + :host(:is([type='button']:not([disabled]), [type='link'])) { + cursor: pointer; + } + md-focus-ring { z-index: 1; @@ -64,6 +68,7 @@ // Resets. These can be removed once we're no longer use these tags background: none; border: none; + cursor: inherit; padding: 0; margin: 0; text-align: unset; diff --git a/list/internal/listitem/list-item.ts b/list/internal/listitem/list-item.ts index 09e27e7791..55ac40043f 100644 --- a/list/internal/listitem/list-item.ts +++ b/list/internal/listitem/list-item.ts @@ -45,7 +45,7 @@ export class ListItemEl extends LitElement implements ListItem { * Sets the behavior of the list item, defaults to "text". Change to "link" or * "button" for interactive items. */ - @property() type: ListItemType = 'text'; + @property({reflect: true}) type: ListItemType = 'text'; /** * READONLY. Sets the `md-list-item` attribute on the element.