Siteimprove a11y fixes - #117
Open
Dananji wants to merge 3 commits into
Open
Conversation
cjcolvar
approved these changes
Aug 5, 2026
cjcolvar
left a comment
There was a problem hiding this comment.
This looks great as far as I can tell by just looking at the code. Nice job refactoring to clean things up and deal with issues in MUI 3!
Comment on lines
+17
to
+18
| /* React 16 doesn't recognize 'inert' as a valid HTML attribute, therefore to safely | ||
| implement 'inert' use a React ref on the HTML element. */ |
| */ | ||
| export const handleFocusTrap = (event, isOpen) => { | ||
| if (event.key !== 'Tab' || !open) return; | ||
| if (event.key !== 'Tab' || !isOpen) return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue: #84
Related a11y issue in #83
Changes in this PR:
ColourSwatchPickerbutton viaaria-labelused by both the annotation edit form and the settings modallabelprop toTimePickerand applyaria-labelto each of its hour/minute/second<input>fieldsuseVolumeSliderwith a new generalizeduseSliderA11ymodule, with a function to patch MUI's Slider a11y in class components (bubble height slider inSettingsPopup) and a custom hook to apply the patch to functional components (VolumeSliderandVolumeSliderCompact)onChangeandonToggleevents that were inuseVolumeSliderand move them inside each relevant component. The MUI's event handlers are partially working for thekeydownevents, therefore handle the mouse/touch event handler portion inside the callback functions in respective componentInertcomponent that sets nativeinertDOM attribute on a wrapped sub-tree of components when a modal is open. This makes all interactive elements in the whole sub-tree unfocusable and unclickable, which clears the SiteImprove flags on the background elements being active when a modal is open.AudioImporterandSettingsPopupmodal elements are rendered as siblings of<Inert>isModalOpenprop inVariationsAppBar,AudioTransportBar,BubbleEditor,TimelineScrubber,Metadata, andProjectMetadataDisplaycomponents where, it is only used for disabling buttons/links when the modal is open. RemovingisModalOpenin these places is safe because,Inertcomponent blocks focus/click actions on the interactive elements in these components. Other props and variables used in thesedisabledattribute in these components are left untouched because they don't rely on the modal visibility.