diff --git a/site/.oxlintrc.jsonc b/site/.oxlintrc.jsonc index d8b046a3cbb..0586fc849e7 100644 --- a/site/.oxlintrc.jsonc +++ b/site/.oxlintrc.jsonc @@ -20,6 +20,7 @@ "tabindex-no-positive": "error", "img-redundant-alt": "error", "no-redundant-roles": "error", + "role-has-required-aria-props": "error", "alt-text": "error", "anchor-has-content": "error", "aria-activedescendant-has-tabindex": "error", @@ -199,7 +200,6 @@ "no-autofocus": "off", // a11y/noAutofocus (large) "no-invalid-void-type": "off", // suspicious/noConfusingVoidType (large) "no-redeclare": "off", // suspicious/noRedeclare (medium: TS declaration merging) - "role-has-required-aria-props": "off", // a11y/useAriaPropsForRole (medium) "no-irregular-whitespace": "off", // suspicious/noIrregularWhitespace (medium) "no-inferrable-types": "off", // style/noInferrableTypes (medium, coder error rule) "consistent-type-imports": "off", // style/useImportType (medium) diff --git a/site/src/components/Autocomplete/Autocomplete.tsx b/site/src/components/Autocomplete/Autocomplete.tsx index a56b4ce2f2d..4b0696c0c25 100644 --- a/site/src/components/Autocomplete/Autocomplete.tsx +++ b/site/src/components/Autocomplete/Autocomplete.tsx @@ -344,6 +344,7 @@ export function Autocomplete({ return ( = ({ // With an unset option the selector stays usable even when no model // options exist, so a saved override can still be switched back. const isDisabled = disabled || (options.length === 0 && !unsetLabel); + const listboxId = useId(); const query = search.trim().toLowerCase(); const optionsByProvider = (() => { const grouped = new Map(); @@ -158,6 +159,7 @@ export const ModelSelector: FC = ({ } aria-expanded={open} aria-haspopup="listbox" + aria-controls={open ? listboxId : undefined} disabled={isDisabled} role="combobox" type="button" @@ -218,6 +220,7 @@ export const ModelSelector: FC = ({ className="h-auto py-0 text-xs font-normal leading-[18px] text-content-primary placeholder:text-content-disabled" />