/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/a11y/src/shared/clear.ts
16 строк
496 B
Kushagra Goyal
TypeScript: Migrate a11y package to TS (#70680)
03 апр 2026, 16:31
Не верифицирован
03 апр 2026, 16:31
592e7c8
Код
Авторство
О чём код?
/** * Clears the a11y-speak-region elements and hides the explanatory text. */ export default function clear(): void { const regions = document.getElementsByClassName( 'a11y-speak-region' ); const introText = document.getElementById( 'a11y-speak-intro-text' ); for ( let i = 0; i < regions.length; i++ ) { regions[ i ].textContent = ''; } // Make sure the explanatory text is hidden from assistive technologies. if ( introText ) { introText.setAttribute( 'hidden', 'hidden' ); } }