/
githubmirror
/
Front-End-Checklist
Обзор
Документация
Войти
/
githubmirror
/
Front-End-Checklist
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/web/lib/accessibility/utils.ts
17 строк
557 B
David Dias
chore: new v2 version
30 май 2026, 00:54
30 май 2026, 00:54
7c05904
Код
Авторство
О чём код?
/** Miscellaneous accessibility helpers. */ /** Focuses and scrolls to the skip-link target element by ID. */ export function handleSkipLink(targetId: string): void { const target = document.getElementById(targetId) if (target) { target.setAttribute('tabindex', '-1') target.focus() target.scrollIntoView({ behavior: 'smooth' }) } } let idCounter = 0 /** Generates a unique ID for ARIA relationship attributes (e.g. aria-labelledby). */ export function generateId(prefix: string = 'aria'): string { return `${prefix}-${++idCounter}` }