Fleet UI: Fix radix missing title/description logs (#47607)

This commit is contained in:
RachelElysia
2026-06-15 13:37:56 -04:00
committed by GitHub
parent 7352b820c5
commit 13ff272e2e
@@ -8,6 +8,10 @@ import React, {
useRef,
} from "react";
import { Command } from "cmdk";
import {
Title as DialogTitle,
Description as DialogDescription,
} from "@radix-ui/react-dialog";
import { browserHistory } from "react-router";
import { AppContext } from "context/app";
@@ -768,6 +772,14 @@ const CommandPalette = (): JSX.Element | null => {
return 0;
}}
>
{/* cmdk's Dialog wraps Radix Dialog.Content, which requires a Title and
a Description for screen reader accessibility — without these, Radix
logs a console error/warning on every open. Both are rendered
visually hidden so the palette UI stays unchanged. */}
<DialogTitle className="sr-only">Command palette</DialogTitle>
<DialogDescription className="sr-only">
Search for a page, command, or resource across Fleet.
</DialogDescription>
<div className={`${baseClass}__input-wrapper`}>
{page !== "root" && (
// tabIndex=-1 so Radix's open-autofocus skips the back button