diff --git a/src/components/applications/file-explorer/FileExplorer.jsx b/src/components/applications/file-explorer/FileExplorer.jsx
index 46c0217..b1780f7 100644
--- a/src/components/applications/file-explorer/FileExplorer.jsx
+++ b/src/components/applications/file-explorer/FileExplorer.jsx
@@ -68,51 +68,52 @@ export function FileExplorer({ startPath }) {
return (
-
- { changeDirectory("~"); }}>
+ { changeDirectory("~"); }}>
Home
- { changeDirectory("~/Desktop"); }}>
+ { changeDirectory("~/Desktop"); }}>
Desktop
- { changeDirectory("~/Documents"); }}>
+ { changeDirectory("~/Documents"); }}>
Documents
- { changeDirectory("~/Images"); }}>
+ { changeDirectory("~/Images"); }}>
Images
{currentDirectory?.getFiles(showHidden)?.map((file, index) =>
-
{
+ {
event.preventDefault();
windowsManager.openFile(file);
}}>
@@ -121,7 +122,7 @@ export function FileExplorer({ startPath }) {
)}
{currentDirectory?.getSubFolders(showHidden)?.map(({ name }, index) =>
- {
+ {
changeDirectory(name);
}}>
diff --git a/src/components/applications/file-explorer/FileExplorer.module.css b/src/components/applications/file-explorer/FileExplorer.module.css
index 59c2755..80a5eb1 100644
--- a/src/components/applications/file-explorer/FileExplorer.module.css
+++ b/src/components/applications/file-explorer/FileExplorer.module.css
@@ -46,7 +46,7 @@
transition: all 200ms ease-in-out;
}
-.Icon-button:hover::after {
+.Icon-button:hover::after, .Icon-button:focus::after {
background-color: rgba(255, 255, 255, 10%);
transform: scale(150%);
}
@@ -102,7 +102,7 @@
transition: background-color 100ms ease-in-out;
}
-.Nav-button:hover {
+.Nav-button:hover, .Nav-button:focus {
background-color: rgba(255, 255, 255, 10%);
}
@@ -138,7 +138,8 @@
transition: background-color 100ms ease-in-out;
}
-.File-button:hover, .Folder-button:hover {
+.File-button:hover, .Folder-button:hover,
+.File-button:focus, .Folder-button:focus {
background-color: rgba(255, 255, 255, 10%);
}
diff --git a/src/components/applications/settings/Settings.module.css b/src/components/applications/settings/Settings.module.css
index 86e3bfa..97e8236 100644
--- a/src/components/applications/settings/Settings.module.css
+++ b/src/components/applications/settings/Settings.module.css
@@ -36,7 +36,7 @@
transition: background-color 100ms ease-in-out;
}
-.Tab-button:hover {
+.Tab-button:hover, .Tab-button:focus {
background-color: rgba(255, 255, 255, 10%);
}
diff --git a/src/components/task-bar/TaskBar.jsx b/src/components/task-bar/TaskBar.jsx
index 0294a42..2f698a1 100644
--- a/src/components/task-bar/TaskBar.jsx
+++ b/src/components/task-bar/TaskBar.jsx
@@ -36,6 +36,7 @@ function AppButton({ app }) {
return (
{ windowsManager.open(app.id); }}
title={app.name}
@@ -102,7 +103,9 @@ export function Taskbar() {
{ updateShowHome(false); }}>
- { updateShowHome(!showHome); }}
>
@@ -113,7 +116,9 @@ export function Taskbar() {
{ updateShowSearch(false); }}>
- { updateShowSearch(!showSearch); }}
>
diff --git a/src/components/task-bar/TaskBar.module.css b/src/components/task-bar/TaskBar.module.css
index 0c47e76..1457041 100644
--- a/src/components/task-bar/TaskBar.module.css
+++ b/src/components/task-bar/TaskBar.module.css
@@ -28,7 +28,7 @@
z-index: -1;
}
-.Task-bar button:hover {
+.Task-bar button:hover, .Task-bar button:focus {
background-color: var(--task-bar-button-hover-color);
}
@@ -95,7 +95,7 @@
-webkit-transform: translateX(-50%);
}
-.App-icon:hover::after {
+.App-icon:hover::after, .App-icon:focus::after {
width: 100%;
}
diff --git a/src/components/task-bar/indicators/Battery.jsx b/src/components/task-bar/indicators/Battery.jsx
index 491ebcd..c4d9e31 100644
--- a/src/components/task-bar/indicators/Battery.jsx
+++ b/src/components/task-bar/indicators/Battery.jsx
@@ -42,7 +42,7 @@ export function Battery() {
battery.removeEventListener("levelchange", updatePercentage);
// battery.removeEventListener("chargingtimechange", updateChargingTime);
// battery.removeEventListener("dischargingtimechange", updateDischargingTime);
- }
+ };
});
}, []);
@@ -58,7 +58,7 @@ export function Battery() {
}
return (
-
+
{!isCharging
?
: null
diff --git a/src/components/task-bar/indicators/Calendar.jsx b/src/components/task-bar/indicators/Calendar.jsx
index 0f50e26..686bcb9 100644
--- a/src/components/task-bar/indicators/Calendar.jsx
+++ b/src/components/task-bar/indicators/Calendar.jsx
@@ -11,7 +11,7 @@ export function Calendar() {
}, []);
return (
-
+
{date.toLocaleString("en-US", {
hour: "numeric",
minute: "numeric",
diff --git a/src/components/task-bar/indicators/Network.jsx b/src/components/task-bar/indicators/Network.jsx
index db666f3..dfd3f33 100644
--- a/src/components/task-bar/indicators/Network.jsx
+++ b/src/components/task-bar/indicators/Network.jsx
@@ -3,7 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
export function Network() {
return (
-
+
);
diff --git a/src/components/task-bar/indicators/Volume.jsx b/src/components/task-bar/indicators/Volume.jsx
index 6694b48..c061b31 100644
--- a/src/components/task-bar/indicators/Volume.jsx
+++ b/src/components/task-bar/indicators/Volume.jsx
@@ -3,7 +3,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
export function Volume() {
return (
-
+
);
diff --git a/src/components/task-bar/menus/HomeMenu.jsx b/src/components/task-bar/menus/HomeMenu.jsx
index 470bad1..352243b 100644
--- a/src/components/task-bar/menus/HomeMenu.jsx
+++ b/src/components/task-bar/menus/HomeMenu.jsx
@@ -8,6 +8,7 @@ import { ReactSVG } from "react-svg";
import { closeTab } from "../../../features/utils/browser.js";
import { useKeyboardListener } from "../../../hooks/utils/keyboard.js";
import { useVirtualRoot } from "../../../hooks/virtual-drive/VirtualRootContext.js";
+import { useEffect, useState } from "react";
/**
* @param {object} props
@@ -18,6 +19,11 @@ import { useVirtualRoot } from "../../../hooks/virtual-drive/VirtualRootContext.
export function HomeMenu({ active, setActive, search }) {
const windowsManager = useWindowsManager();
const virtualRoot = useVirtualRoot();
+ const [tabIndex, setTabIndex] = useState(active ? 0 : -1);
+
+ useEffect(() => {
+ setTabIndex(active ? 0 : -1);
+ }, [active]);
const classNames = [styles["Container-outer"]];
if (active)
@@ -35,7 +41,7 @@ export function HomeMenu({ active, setActive, search }) {
search(event.key);
}
}
- }
+ };
const onKeyUp = (event) => {
if (event.key === "Alt" && onlyAltKey) {
@@ -45,7 +51,7 @@ export function HomeMenu({ active, setActive, search }) {
} else {
onlyAltKey = false;
}
- }
+ };
useKeyboardListener({ onKeyDown, onKeyUp });
@@ -53,16 +59,16 @@ export function HomeMenu({ active, setActive, search }) {
-
{ closeTab(); }}>
+ { closeTab(); }}>
- {
+ {
setActive(false);
windowsManager.open("settings");
}}>
- {
+ {
setActive(false);
windowsManager.open("text-editor", {
mode: "view",
@@ -71,13 +77,13 @@ export function HomeMenu({ active, setActive, search }) {
}}>
- {
+ {
setActive(false);
windowsManager.open("file-explorer", { startPath: "~/Images" });
}}>
- {
+ {
setActive(false);
windowsManager.open("file-explorer", { startPath: "~/Documents" }); }
}>
@@ -91,6 +97,7 @@ export function HomeMenu({ active, setActive, search }) {
{
setActive(false);
windowsManager.open(id);
diff --git a/src/components/task-bar/menus/SearchMenu.jsx b/src/components/task-bar/menus/SearchMenu.jsx
index 263a242..0bf404b 100644
--- a/src/components/task-bar/menus/SearchMenu.jsx
+++ b/src/components/task-bar/menus/SearchMenu.jsx
@@ -17,6 +17,11 @@ import { useState } from "react";
export function SearchMenu({ active, setActive, searchQuery, setSearchQuery, inputRef }) {
const windowsManager = useWindowsManager();
const [apps, setApps] = useState(null);
+ const [tabIndex, setTabIndex] = useState(active ? 0 : -1);
+
+ useEffect(() => {
+ setTabIndex(active ? 0 : -1);
+ }, [active]);
useEffect(() => {
if (inputRef.current)
@@ -32,7 +37,7 @@ export function SearchMenu({ active, setActive, searchQuery, setSearchQuery, inp
const onChange = (event) => {
const value = event.target.value;
setSearchQuery(value);
- }
+ };
const classNames = [styles["Container-outer"]];
if (active && apps)
@@ -44,6 +49,7 @@ export function SearchMenu({ active, setActive, searchQuery, setSearchQuery, inp
{
setActive(false);
windowsManager.open(id);
diff --git a/src/components/utils/DropdownButton.jsx b/src/components/utils/DropdownButton.jsx
index 6495d04..d37f60b 100644
--- a/src/components/utils/DropdownButton.jsx
+++ b/src/components/utils/DropdownButton.jsx
@@ -12,16 +12,20 @@ import { formatShortcut } from "../../features/utils/string.js";
export function DropdownButton({ label, options, shortcuts }) {
const [open, setOpen] = useState(false);
+ const tabIndex = () => {
+ return open ? 0 : -1;
+ };
+
return (
{ setOpen(false); }}>
-
{ setOpen(!open); }}>
+ { setOpen(!open); }}>
{label}
{open && options
? (
{Object.entries(options).map(([label, callback]) =>
-
{
+ {
setOpen(false);
callback();
}}>
diff --git a/src/components/utils/DropdownButton.module.css b/src/components/utils/DropdownButton.module.css
index aed6e6f..053b0a3 100644
--- a/src/components/utils/DropdownButton.module.css
+++ b/src/components/utils/DropdownButton.module.css
@@ -14,7 +14,7 @@
cursor: pointer;
}
-.Button:hover {
+.Button:hover, .Button:focus {
background-color: rgba(255, 255, 255, 5%);
}
@@ -42,7 +42,7 @@
cursor: pointer;
}
-.Dropdown > button:hover {
+.Dropdown > button:hover, .Dropdown > button:focus {
background-color: rgba(255, 255, 255, 5%);
}
diff --git a/src/components/windows/Window.jsx b/src/components/windows/Window.jsx
index 8c409da..fd4310f 100644
--- a/src/components/windows/Window.jsx
+++ b/src/components/windows/Window.jsx
@@ -43,7 +43,7 @@ export function Window({ id, app, size, position, focused = false, onInteract, o
});
const close = (event) => {
- event.preventDefault();
+ event?.preventDefault();
windowsManager.close(id);
};
@@ -89,15 +89,18 @@ export function Window({ id, app, size, position, focused = false, onInteract, o
onClick={focus}
>
-
+
{title}
-
setMinimized(!minimized)}>
+ setMinimized(!minimized)}>
- setMaximized(!maximized)}>
+ setMaximized(!maximized)}>
-
+
diff --git a/src/components/windows/Window.module.css b/src/components/windows/Window.module.css
index 3f91500..cca9871 100644
--- a/src/components/windows/Window.module.css
+++ b/src/components/windows/Window.module.css
@@ -92,7 +92,7 @@
outline: none;
}
-.Header button:hover {
+.Header button:hover, .Header button:focus {
background-color: var(--header-button-hover-color);
}
diff --git a/src/features/applications/applications.js b/src/features/applications/applications.js
index 7afda23..494625f 100644
--- a/src/features/applications/applications.js
+++ b/src/features/applications/applications.js
@@ -1,4 +1,3 @@
-/* eslint-disable eqeqeq */
import Application from "./application.js";
import { FileExplorer } from "../../components/applications/file-explorer/FileExplorer.jsx";
import { MediaViewer } from "../../components/applications/media-viewer/MediaViewer.jsx";
@@ -29,7 +28,7 @@ export default class ApplicationsManager {
let application = null;
this.APPLICATIONS.forEach((app) => {
- if (app.id == id) {
+ if (app.id === id) {
application = app;
return;
}