Skip to content

Commit

Permalink
Minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
endigo9740 committed Oct 27, 2023
1 parent 6275986 commit ea10632
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/skeleton/src/lib/components/AppRail/AppRailTile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// Classes
const cBase = 'cursor-pointer';
const cWrapper = 'flex flex-col justify-center items-stretch';
const cWrapper = 'flex flex-col justify-center items-stretch w-full';
const cInterface = 'text-center';
const cLabel = 'font-bold text-xs';
Expand All @@ -60,7 +60,7 @@
$: classesLabel = `${cLabel} ${regionLabel}`;
// A11y Key Down Handler
function onKeyDown(event: SvelteEvent<KeyboardEvent, HTMLDivElement>): void {
function onKeyDown(event: SvelteEvent<KeyboardEvent, HTMLButtonElement>): void {
if (['Enter', 'Space'].includes(event.code)) {
event.preventDefault();
elemInput.click();
Expand All @@ -76,9 +76,7 @@

<label class="app-rail-tile {classesBase}" data-testid="app-rail-tile" {title} on:mouseover on:mouseleave on:focus on:blur>
<!-- A11y attributes are not allowed on <label> -->
<!-- FIXME: resolve a11y warnings -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="app-rail-wrapper {classesWrapper}" tabindex="0" role="button" on:keydown={onKeyDown} on:keyup on:keypress>
<button class="app-rail-wrapper {classesWrapper}" tabindex="0" on:keydown={onKeyDown} on:keyup on:keypress>
<!-- NOTE: Don't use `hidden` as it prevents `required` from operating -->
<div class="h-0 w-0 overflow-hidden">
<input bind:this={elemInput} type="radio" bind:group {name} {value} {...prunedRestProps()} tabindex="-1" on:click on:change />
Expand All @@ -88,5 +86,5 @@
{#if $$slots.lead}<div class="app-rail-lead {classesLead}"><slot name="lead" /></div>{/if}
<div class="app-rail-label {classesLabel}"><slot /></div>
</div>
</div>
</button>
</label>

0 comments on commit ea10632

Please sign in to comment.