diff --git a/services/web/frontend/js/features/symbol-palette/components/symbol-palette-body.js b/services/web/frontend/js/features/symbol-palette/components/symbol-palette-body.js
index d6a8908354..b7b90d6312 100644
--- a/services/web/frontend/js/features/symbol-palette/components/symbol-palette-body.js
+++ b/services/web/frontend/js/features/symbol-palette/components/symbol-palette-body.js
@@ -13,35 +13,44 @@ export default function SymbolPaletteBody({
}) {
const { t } = useTranslation()
- // not searching: show the symbols grouped by category
- if (!filteredSymbols) {
+ // searching with matches: show the matched symbols
+ // searching with no matches: show a message
+ // note: include empty tab panels so that aria-controls on tabs can still reference the panel ids
+ if (filteredSymbols) {
return (
-
- {categories.map(category => (
-
-
-
- ))}
-
+ <>
+ {filteredSymbols.length ? (
+
+ ) : (
+
{t('no_symbols_found')}
+ )}
+
+
+ {categories.map(category => (
+
+ ))}
+
+ >
)
}
- // searching with no matches: show a message
- if (!filteredSymbols.length) {
- return {t('no_symbols_found')}
- }
-
- // searching with matches: show the matched symbols
+ // not searching: show the symbols grouped by category
return (
-
+
+ {categories.map(category => (
+
+
+
+ ))}
+
)
}
SymbolPaletteBody.propTypes = {
diff --git a/services/web/frontend/js/features/symbol-palette/components/symbol-palette-item.js b/services/web/frontend/js/features/symbol-palette/components/symbol-palette-item.js
index 9ffaf1db63..c17852451e 100644
--- a/services/web/frontend/js/features/symbol-palette/components/symbol-palette-item.js
+++ b/services/web/frontend/js/features/symbol-palette/components/symbol-palette-item.js
@@ -30,9 +30,7 @@ export default function SymbolPaletteItem({
{symbol.description}
-
- {symbol.command}
-
+ {symbol.command}
{symbol.notes && (
{symbol.notes}
)}
@@ -47,9 +45,10 @@ export default function SymbolPaletteItem({
tabIndex={focused ? 0 : -1}
ref={buttonRef}
role="option"
- aria-selected={focused}
+ aria-label={symbol.description}
+ aria-selected={focused ? 'true' : 'false'}
>
- {symbol.character}
+ {symbol.character}
)