a11y: admin/custom: text for switch element
Massimo Melina committed
Mar 24, 2025 at 12:44 UTC
9d76b484095508b79a9a4301915673a4e67baef9
2 files changed
+2
-2
admin/src/CustomHtmlPage.ts
+1
-1
@@ -65,7 +65,7 @@ export default function CustomHtmlPage({ setTitleSide }: PageProps) {
65
modified: anyChange,
66
onClick: save,
67
}),
68
- hTooltip("Enable / Disable", undefined, switchBtn(enabled, async v => {
68
+ hTooltip("Enable all sections", undefined, switchBtn(enabled, async v => {
69
await apiCall('set_config', { values: { [CFG.disable_custom_html]: !v } })
70
setEnabled(v)
71
})),
admin/src/mui.ts
+1
-1
@@ -322,7 +322,7 @@ async function ip2countryBatch(ips: string[]) {
322
// force you to think of aria when adding a tooltip
323
export function hTooltip(title: ReactNode, ariaLabel: string | undefined, children: ReactElement, props?: Omit<TooltipProps, 'title' | 'children'> & { key?: any }) {
324
return h(Tooltip, { title, children,
325
- ...ariaLabel === '' ? { 'aria-hidden': true } : { 'aria-label': ariaLabel },
325
+ ...ariaLabel === '' ? { 'aria-hidden': true } : { 'aria-label': ariaLabel || _.isString(title) && title || undefined },
326
componentsProps: { popper: { sx: { whiteSpace: 'pre-wrap', ...props?.sx } } },
327
...props
328
})