Skip to content

Commit

Permalink
accessibility fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-mxwl committed Mar 18, 2024
1 parent 229ba50 commit 787cfc1
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0"
},
"dependencies": {
"@originjs/vite-plugin-federation": "^1.3.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-drag-drop-files": "^2.3.10"
Expand Down
18 changes: 16 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react'
import React from "react";
import { useState, useEffect } from "react";
import Knob from "./components/Knob.jsx";
import DragDrop from "./components/DragDrop.jsx";
import InfoModal from "./components/InfoModal.jsx";
import "./App.css"
import "./App.css";

const ctx = new AudioContext();
const reader1 = new FileReader();
Expand Down Expand Up @@ -363,21 +363,35 @@ export default function App() {
<div className="control-bar-filter">
{"@"} Filter{" "}
<a
title="Filter On"
onClick={handleFilterClick}
style={{
color: !toggleFilter && "gray",
filter: !toggleFilter && "none",
}}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleFilterClick();
}
}}
>
On
</a>
{" | "}
<a
title="Filter Off"
onClick={handleFilterClick}
style={{
color: toggleFilter && "gray",
filter: toggleFilter && "none",
}}
tabIndex={0}
onKeyDown={(e) => {
if (e.key === "Enter") {
handleFilterClick();
}
}}
>
Off
</a>
Expand Down
6 changes: 6 additions & 0 deletions src/components/Knob.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ export default function Knob(props) {
}
})
);

currentValueRef.current.addEventListener("keydown", (e) => {
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
e.preventDefault();
}
});
}

return (
Expand Down

0 comments on commit 787cfc1

Please sign in to comment.