Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alertdialog role to confirmation #2090

Merged
merged 14 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/content/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface ModalWithScrollLockProps extends StyledComponentProps<'div', {}, {}, '
const ModalWithScrollLock = React.forwardRef<HTMLDivElement, ModalWithScrollLockProps>(
({ children, scrollLockProps, ...props }: ModalWithScrollLockProps, ref) => {
return createPortal(
<PopupWrapper>
<PopupWrapper role='dialog' aria-modal='true'>
<ScrollLock {...scrollLockProps} />
<ModalWrapper ref={ref} {...props}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/app/content/components/popUp/FiltersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const FiltersList = ({
});
};

return <ul className={className}>
return <ul className={className} aria-live='polite' aria-atomic='true'>
{Array.from(locationFilters).map(([locationId, location]) => selectedLocationFilters.has(locationId) &&
<FiltersListChapter
key={locationId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ exports[`Filters matches snapshot 1`] = `
</button>
</div>
<ul
aria-atomic="true"
aria-live="polite"
className="c16 c17"
>
<li
Expand Down Expand Up @@ -1124,6 +1126,8 @@ exports[`Filters matches snapshot when open color filters 1`] = `
</button>
</div>
<ul
aria-atomic="true"
aria-live="polite"
className="c18 c19"
/>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/app/content/highlights/components/Confirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const Confirmation = React.forwardRef<HTMLElement, Props>((
return <Overlay
ref={mergeRefs(ref, drawFocus ? drawFocusRef : null)}
tabIndex={-1}
role='alertdialog'
{...props['data-analytics-region']
? {'data-analytics-region': props['data-analytics-region']}
: {}
Expand Down
2 changes: 1 addition & 1 deletion src/app/content/highlights/components/Highlights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const Highlights = ({ className }: { className: string }) => {

return <React.Fragment>
{isLoading ? <LoaderWrapper><Loader large /></LoaderWrapper> : null}
{orderedHighlights && <HighlightsWrapper ref={container} className={className}>
{orderedHighlights && <HighlightsWrapper ref={container} className={className} aria-live='polite'>
{orderedHighlights.map((highlightData) => {
return <SectionHighlights
key={highlightData.location.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,8 @@ input:checked + .c21 .c22 {
</button>
</div>
<ul
aria-atomic="true"
aria-live="polite"
className="c44 c45"
>
<li
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ exports[`Confirmation matches snapshot no selection 1`] = `
<div
className="c0"
data-analytics-region="region"
role="alertdialog"
tabIndex={-1}
>
<label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ exports[`KeyboardShortcuts renders keyboard shortcuts modal if it is open 1`] =
}

<div
aria-modal="true"
className="c0"
role="dialog"
>
<div
className="c1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,9 @@ exports[`PracticeQuestions renders practice questions modal if it is open 1`] =
}

<div
aria-modal="true"
className="c0"
role="dialog"
>
<div
className="c1"
Expand Down
4 changes: 2 additions & 2 deletions src/app/content/studyGuides/components/StudyGuides.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ const StudyGuides = ({ className }: { className: string }) => {
return <div className={className}>
{isLoading ? <LoaderWrapper><Loader large /></LoaderWrapper> : null}
{(!isLoading && orderedStudyGuides && orderedStudyGuides.length === 0) ?
<HighlightsWrapper ref={container}>
<HighlightsWrapper ref={container} aria-live='polite'>
<GeneralCenterText>
<FormattedMessage id='i18n:studyguides:popup:no-highlights'>
{(msg) => msg}
</FormattedMessage>
<NoStudyGuidesTip />
</GeneralCenterText>
</HighlightsWrapper>
: orderedStudyGuides && <HighlightsWrapper ref={container}>
: orderedStudyGuides && <HighlightsWrapper ref={container} aria-live='polite'>
{orderedStudyGuides.map((highlightData) => {
return <SectionHighlights
key={highlightData.location.id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1776,6 +1776,8 @@ input:checked + .c21 .c22 {
</button>
</div>
<ul
aria-atomic="true"
aria-live="polite"
className="c57 c58"
>
<li
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ exports[`StudyGuides properly display summary highlights 1`] = `
className="c0"
>
<div
aria-live="polite"
className="c1"
>
<div
Expand Down
Loading