mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-07-13 02:53:45 +00:00
feat(#57): Improve accessibility of dropdown
This commit is contained in:
@@ -346,6 +346,7 @@
|
|||||||
style="--boxes-per-row: {boxesPerRow}; --cell-padding: {cellPaddingRem}rem; --sprite-size: {spriteSizePx}px;"
|
style="--boxes-per-row: {boxesPerRow}; --cell-padding: {cellPaddingRem}rem; --sprite-size: {spriteSizePx}px;"
|
||||||
>
|
>
|
||||||
{#each boxNumbers as boxNumber}
|
{#each boxNumbers as boxNumber}
|
||||||
|
{@const bulkMenuId = `box-${boxNumber}-bulk-menu`}
|
||||||
<div class="mb-8">
|
<div class="mb-8">
|
||||||
<div class="flex flex-wrap items-center justify-between gap-3 mb-4 relative z-20">
|
<div class="flex flex-wrap items-center justify-between gap-3 mb-4 relative z-20">
|
||||||
<h2 class="text-xl font-bold">Box {boxNumber}</h2>
|
<h2 class="text-xl font-bold">Box {boxNumber}</h2>
|
||||||
@@ -355,6 +356,7 @@
|
|||||||
class="btn btn-sm btn-outline relative z-[210]"
|
class="btn btn-sm btn-outline relative z-[210]"
|
||||||
aria-label="Open bulk actions menu"
|
aria-label="Open bulk actions menu"
|
||||||
aria-haspopup="menu"
|
aria-haspopup="menu"
|
||||||
|
aria-controls={bulkMenuId}
|
||||||
aria-expanded={openBulkMenuForBox === boxNumber}
|
aria-expanded={openBulkMenuForBox === boxNumber}
|
||||||
on:click={(event) => {
|
on:click={(event) => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
@@ -369,12 +371,13 @@
|
|||||||
|
|
||||||
{#if openBulkMenuForBox === boxNumber}
|
{#if openBulkMenuForBox === boxNumber}
|
||||||
<ul
|
<ul
|
||||||
|
id={bulkMenuId}
|
||||||
class="menu bg-base-100 rounded-box absolute right-0 mt-2 z-[220] w-56 p-2 shadow border border-base-300"
|
class="menu bg-base-100 rounded-box absolute right-0 mt-2 z-[220] w-56 p-2 shadow border border-base-300"
|
||||||
role="menu"
|
|
||||||
on:click|stopPropagation
|
on:click|stopPropagation
|
||||||
>
|
>
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
markBoxAsNotCaught(boxNumber);
|
markBoxAsNotCaught(boxNumber);
|
||||||
openBulkMenuForBox = null;
|
openBulkMenuForBox = null;
|
||||||
@@ -385,6 +388,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
markBoxAsCaught(boxNumber);
|
markBoxAsCaught(boxNumber);
|
||||||
openBulkMenuForBox = null;
|
openBulkMenuForBox = null;
|
||||||
@@ -395,6 +399,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
markBoxAsNeedsToEvolve(boxNumber);
|
markBoxAsNeedsToEvolve(boxNumber);
|
||||||
openBulkMenuForBox = null;
|
openBulkMenuForBox = null;
|
||||||
@@ -405,6 +410,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
markBoxAsInHome(boxNumber);
|
markBoxAsInHome(boxNumber);
|
||||||
openBulkMenuForBox = null;
|
openBulkMenuForBox = null;
|
||||||
@@ -415,6 +421,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
markBoxAsNotInHome(boxNumber);
|
markBoxAsNotInHome(boxNumber);
|
||||||
openBulkMenuForBox = null;
|
openBulkMenuForBox = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user