Skip to content

Commit

Permalink
fix: accessibility improvements
Browse files Browse the repository at this point in the history
Set role of math-filed to "textbox math" since some browsers are not recognizing the the web component.

Also, setting cell drag handles to aria role of none since the functionality is duplicated by the move up and move down buttons for each cell.
  • Loading branch information
mgreminger committed Sep 12, 2023
1 parent 9871429 commit 2fbabf6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Cell.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
</IconButton>
</span>
<span
role="none"
class="handle button-container"
on:mousedown={startDrag}
on:touchstart|nonpassive={startDrag}
Expand All @@ -196,6 +197,7 @@
<!-- The static element action to select is cell is made available through the keyboard shortcuts
of Ctrl+ArrowUp and Ctrl+ArrowDown -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->

<div
class="content" class:selected
Expand Down
1 change: 1 addition & 0 deletions src/DropOverlay.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
The overlay contains instructions for how to dismiss by either pressing escape or clicking
the overlay -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="drop-overlay"
on:drop|preventDefault
Expand Down
4 changes: 4 additions & 0 deletions src/MathField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,12 @@
</style>

<!-- Suppressing some Svelte A11y warnings since math-field is not recognized as an interactive element -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<!-- svelte-ignore a11y-interactive-supports-focus -->

<math-field
role="textbox math"
min-font-scale=0.75
on:focusin={handleFocusIn}
on:focusout={handleFocusOut}
Expand Down

0 comments on commit 2fbabf6

Please sign in to comment.