Skip to content

Commit ca3778e

Browse files
committed
fix(Item): fix aria warnings in List Item
1 parent ba4798d commit ca3778e

File tree

1 file changed

+22
-25
lines changed

1 file changed

+22
-25
lines changed

components/mdc/List/Item.svelte

+22-25
Original file line numberDiff line numberDiff line change
@@ -51,35 +51,32 @@ img {
5151
class:mdc-deprecated-list-item--activated={activated}
5252
class:mdc-deprecated-list-item--disabled={nonInteractive}
5353
data-mdc-dialog-action={$$props['data-mdc-dialog-action']}
54-
on:click
55-
on:keydown
56-
on:keypress
57-
on:keyup
58-
{tabindex}
5954
>
60-
{#if graphicURL}
61-
<div class="mdc-deprecated-list-item__graphic">
62-
<img class="br-50" alt={graphicAlt} src={graphicURL} />
63-
</div>
64-
{:else if icon}
65-
<i class="material-icons mdc-deprecated-list-item__graphic" aria-hidden="true">{icon}</i>
66-
{/if}
55+
<div role="button" {tabindex} on:click on:keydown on:keypress on:keyup>
56+
{#if graphicURL}
57+
<div class="mdc-deprecated-list-item__graphic">
58+
<img class="br-50" alt={graphicAlt} src={graphicURL} />
59+
</div>
60+
{:else if icon}
61+
<i class="material-icons mdc-deprecated-list-item__graphic" aria-hidden="true">{icon}</i>
62+
{/if}
6763

68-
<span class="mdc-deprecated-list-item__ripple" />
64+
<span class="mdc-deprecated-list-item__ripple" />
6965

70-
<span class="mdc-deprecated-list-item__text" class:nonInteractive>
71-
{#if primary || secondary}
72-
<span class="mdc-deprecated-list-item__primary-text">{primary}</span>
73-
<span class="mdc-deprecated-list-item__secondary-text">{secondary}</span>
74-
{:else}
75-
{text}
76-
<slot />
77-
{/if}
78-
</span>
66+
<span class="mdc-deprecated-list-item__text" class:nonInteractive>
67+
{#if primary || secondary}
68+
<span class="mdc-deprecated-list-item__primary-text">{primary}</span>
69+
<span class="mdc-deprecated-list-item__secondary-text">{secondary}</span>
70+
{:else}
71+
{text}
72+
<slot />
73+
{/if}
74+
</span>
7975

80-
<div class="mdc-deprecated-list-item__meta">
81-
{meta}
82-
<slot name="meta" />
76+
<div class="mdc-deprecated-list-item__meta">
77+
{meta}
78+
<slot name="meta" />
79+
</div>
8380
</div>
8481
</li>
8582

0 commit comments

Comments
 (0)