docs: handle warnings in examples page (#8836)

ignore some, fix others

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
pull/8851/head
Alimurtuza 2 years ago committed by GitHub
parent 68e6336637
commit bbcb5f58ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,6 +7,7 @@
} }
</script> </script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div on:mousemove={handleMousemove}> <div on:mousemove={handleMousemove}>
The mouse position is {m.x} x {m.y} The mouse position is {m.x} x {m.y}
</div> </div>

@ -2,6 +2,7 @@
let m = { x: 0, y: 0 }; let m = { x: 0, y: 0 };
</script> </script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div on:mousemove={(e) => (m = { x: e.clientX, y: e.clientY })}> <div on:mousemove={(e) => (m = { x: e.clientX, y: e.clientY })}>
The mouse position is {m.x} x {m.y} The mouse position is {m.x} x {m.y}
</div> </div>

@ -24,6 +24,7 @@
</label> </label>
</div> </div>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<svg <svg
on:mousemove={(e) => coords.set({ x: e.clientX, y: e.clientY })} on:mousemove={(e) => coords.set({ x: e.clientX, y: e.clientY })}
on:mousedown={() => size.set(30)} on:mousedown={() => size.set(30)}

@ -49,6 +49,7 @@
{#if selected} {#if selected}
{#await selected then d} {#await selected then d}
<div class="photo" in:receive={{ key: d.id }} out:send={{ key: d.id }}> <div class="photo" in:receive={{ key: d.id }} out:send={{ key: d.id }}>
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-noninteractive-element-interactions -->
<img alt={d.alt} src="{ASSETS}/{d.id}.jpg" on:click={() => (selected = null)} /> <img alt={d.alt} src="{ASSETS}/{d.id}.jpg" on:click={() => (selected = null)} />
<p class="credit"> <p class="credit">

@ -28,8 +28,8 @@
{:else} {:else}
<ul> <ul>
{#each [...eases] as [name]} {#each [...eases] as [name]}
<li class:selected={name === current_ease} on:click={() => (current_ease = name)}> <li class:selected={name === current_ease}>
{name} <button on:click={() => (current_ease = name)}> {name}</button>
</li> </li>
{/each} {/each}
</ul> </ul>
@ -46,8 +46,8 @@
{:else} {:else}
<ul> <ul>
{#each types as [name, type]} {#each types as [name, type]}
<li class:selected={type === current_type} on:click={() => (current_type = type)}> <li class:selected={type === current_type}>
{name} <button on:click={() => (current_type = type)}> {name}</button>
</li> </li>
{/each} {/each}
</ul> </ul>

@ -10,6 +10,7 @@
} }
</script> </script>
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div on:mouseenter={enter} on:mouseleave={leave}> <div on:mouseenter={enter} on:mouseleave={leave}>
<slot {hovering} /> <slot {hovering} />
</div> </div>

@ -6,12 +6,13 @@
$: if (dialog && showModal) dialog.showModal(); $: if (dialog && showModal) dialog.showModal();
</script> </script>
<!-- svelte-ignore a11y-click-events-have-key-events --> <!-- svelte-ignore a11y-click-events-have-key-events a11y-no-noninteractive-element-interactions -->
<dialog <dialog
bind:this={dialog} bind:this={dialog}
on:close={() => (showModal = false)} on:close={() => (showModal = false)}
on:click|self={() => dialog.close()} on:click|self={() => dialog.close()}
> >
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div on:click|stopPropagation> <div on:click|stopPropagation>
<slot name="header" /> <slot name="header" />
<hr /> <hr />

@ -11,7 +11,7 @@
} }
</script> </script>
<span class:expanded on:click={toggle}>{name}</span> <button class:expanded on:click={toggle}>{name}</button>
{#if expanded} {#if expanded}
<ul transition:slide={{ duration: 300 }}> <ul transition:slide={{ duration: 300 }}>
@ -28,12 +28,14 @@
{/if} {/if}
<style> <style>
span { button {
padding: 0 0 0 1.5em; padding: 0 0 0 1.5em;
background: url(/tutorial/icons/folder.svg) 0 0.1em no-repeat; background: url(/tutorial/icons/folder.svg) 0 0.1em no-repeat;
background-size: 1em 1em; background-size: 1em 1em;
font-weight: bold; font-weight: bold;
cursor: pointer; cursor: pointer;
border:none;
font-size:14px;
} }
.expanded { .expanded {

@ -69,9 +69,10 @@ radius of the selected circle.
<button on:click={() => travel(-1)} disabled={i === 0}>undo</button> <button on:click={() => travel(-1)} disabled={i === 0}>undo</button>
<button on:click={() => travel(+1)} disabled={i === undoStack.length - 1}>redo</button> <button on:click={() => travel(+1)} disabled={i === undoStack.length - 1}>redo</button>
</div> </div>
<!-- svelte-ignore a11y-click-events-have-key-events a11y-no-static-element-interactions -->
<svg on:click={handleClick}> <svg on:click={handleClick}>
{#each circles as circle} {#each circles as circle}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<circle <circle
cx={circle.cx} cx={circle.cx}
cy={circle.cy} cy={circle.cy}

@ -27,10 +27,10 @@
<h2>Immutable</h2> <h2>Immutable</h2>
{#each todos as todo} {#each todos as todo}
<ImmutableTodo {todo} on:click={() => toggle(todo.id)} /> <ImmutableTodo {todo} on:click={() => toggle(todo.id)} /><br>
{/each} {/each}
<h2>Mutable</h2> <h2>Mutable</h2>
{#each todos as todo} {#each todos as todo}
<MutableTodo {todo} on:click={() => toggle(todo.id)} /> <MutableTodo {todo} on:click={() => toggle(todo.id)} /><br>
{/each} {/each}

@ -6,23 +6,25 @@
export let todo; export let todo;
let div; let btn;
afterUpdate(() => { afterUpdate(() => {
flash(div); flash(btn);
}); });
</script> </script>
<!-- the text will flash red whenever <!-- the text will flash red whenever
the `todo` object changes --> the `todo` object changes -->
<div bind:this={div} on:click> <button bind:this={btn} on:click>
{todo.done ? '👍' : ''} {todo.done ? '👍' : ''}
{todo.text} {todo.text}
</div> </button>
<style> <style>
div { button {
cursor: pointer; cursor: pointer;
line-height: 1.5; border:none;
background:none;
font-size:14px;
} }
</style> </style>

@ -4,23 +4,25 @@
export let todo; export let todo;
let div; let btn;
afterUpdate(() => { afterUpdate(() => {
flash(div); flash(btn);
}); });
</script> </script>
<!-- the text will flash red whenever <!-- the text will flash red whenever
the `todo` object changes --> the `todo` object changes -->
<div bind:this={div} on:click> <button bind:this={btn}>
{todo.done ? '👍' : ''} {todo.done ? '👍' : ''}
{todo.text} {todo.text}
</div> </button>
<style> <style>
div { button {
cursor: pointer; cursor: pointer;
line-height: 1.5; border:none;
background:none;
font-size:14px;
} }
</style> </style>

Loading…
Cancel
Save