Fix a11y checker refusing to close in NQ

flag=none
fixes RCX-1836

Test Plan:
 - Copy RCE changes into NQ
 - In NQ, open an RCE, open a11y checker
 - Click off RCE so it collapses
 - Re-open RCE and a11y checker
 - Click off RCE so it collapses
 - Close the a11y checker
 * Verify it closes

Change-Id: Icb78b6924f8228c5fb2a9da9d0a2f1248b731f88
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/348486
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Mysti Lilla <mysti@instructure.com>
QA-Review: Mysti Lilla <mysti@instructure.com>
Product-Review: Jacob DeWar <jacob.dewar@instructure.com>
This commit is contained in:
Jacob DeWar 2024-05-28 13:32:43 -04:00
parent d8484b4156
commit a65e5ac74c
3 changed files with 20 additions and 11 deletions

View File

@ -5,26 +5,32 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- A11y checker tray refusing to close in New Quizzes
## 5.13.0 - 2024-05-14
### Added
- Find and Replace Tray
- Support for Bahasa Indonesia Language and Irish (Gaeilge) Language
- Support for tools to always be present in toolbar
- LTI enhancements
- Find and Replace Tray
- Support for Bahasa Indonesia Language and Irish (Gaeilge) Language
- Support for tools to always be present in toolbar
- LTI enhancements
### Changed
- Limited list of fonts to self-hosted and websafe
- Preferred HTML editor stored in localstorage
- Stopped adding aria-hidden to RCEs parent label
- Limited list of fonts to self-hosted and websafe
- Preferred HTML editor stored in localstorage
- Stopped adding aria-hidden to RCEs parent label
### Fixed
- Focus properly restored after closing a11y checker
- Allow non relative video srcs when editing captions
- Enhanced user content now translated correctly
- Allow non relative video srcs when editing captions
- Enhanced user content now translated correctly
## 5.12.2 - 2024-01-31
@ -57,7 +63,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Show media captions in New Quizzes
- Bump Instui to 8.49
## 5.11.1 - 2023-10-12
### Fixed

View File

@ -88,4 +88,8 @@ describe('clearIndicators', () => {
clearIndicators(document)
expect(document.getElementById(A11Y_CHECKER_STYLE_ELEM_ID).textContent).toEqual('')
})
it('does not throw when doc null', () => {
expect(() => clearIndicators(null)).not.toThrow()
})
})

View File

@ -31,7 +31,7 @@ export const A11Y_CHECKER_STYLE_ELEM_ID = 'a11y-checker-style'
// Remove the current indicator(s) by removing the contents of
// the style element
export function clearIndicators(doc) {
const checker_style = doc.getElementById(A11Y_CHECKER_STYLE_ELEM_ID)
const checker_style = doc?.getElementById(A11Y_CHECKER_STYLE_ELEM_ID)
if (checker_style) {
checker_style.textContent = ''
}