Skip to content

Commit 8b462fd

Browse files
authored
[docs] Fix 3.52.0 a11y warning in svelte-self tutorial (#7988)
* fix svelte 3.52 a11y warning * replace span with button and drop on:keyup
1 parent 6923b2e commit 8b462fd

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

site/content/tutorial/16-special-elements/01-svelte-self/app-a/Folder.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
</script>
1212

13-
<span class:expanded on:click={toggle}>{name}</span>
13+
<button class:expanded on:click={toggle}>{name}</button>
1414

1515
{#if expanded}
1616
<ul>
@@ -27,12 +27,14 @@
2727
{/if}
2828

2929
<style>
30-
span {
30+
button {
3131
padding: 0 0 0 1.5em;
3232
background: url(/tutorial/icons/folder.svg) 0 0.1em no-repeat;
3333
background-size: 1em 1em;
3434
font-weight: bold;
3535
cursor: pointer;
36+
border: none;
37+
margin: 0;
3638
}
3739
3840
.expanded {

site/content/tutorial/16-special-elements/01-svelte-self/app-b/Folder.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
</script>
1212

13-
<span class:expanded on:click={toggle}>{name}</span>
13+
<button class:expanded on:click={toggle}>{name}</button>
1414

1515
{#if expanded}
1616
<ul>
@@ -27,12 +27,14 @@
2727
{/if}
2828

2929
<style>
30-
span {
30+
button {
3131
padding: 0 0 0 1.5em;
3232
background: url(/tutorial/icons/folder.svg) 0 0.1em no-repeat;
3333
background-size: 1em 1em;
3434
font-weight: bold;
3535
cursor: pointer;
36+
border: none;
37+
margin: 0;
3638
}
3739
3840
.expanded {

0 commit comments

Comments
 (0)