Skip to content

Commit fcb2dd2

Browse files
committed
more accessibility fixes
1 parent ed7c1d4 commit fcb2dd2

12 files changed

Lines changed: 77 additions & 34 deletions

src/ui/LargeModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const LargeModal: FC<IProps> = ({
3131
aria={{ labelledby: 'large-modal-heading' }}
3232
>
3333
<div className="monitor-modal-container">
34-
<section id="close">
34+
<div id="close">
3535
<button
3636
className="close-button"
3737
aria-label={t('close')}
@@ -44,7 +44,7 @@ const LargeModal: FC<IProps> = ({
4444
width={24}
4545
/>
4646
</button>
47-
</section>
47+
</div>
4848
<h2 id="large-modal-heading" className="monitor-modal-header">
4949
{t(header)}
5050
</h2>

src/ui/MapModal.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
align-items: center;
1616
justify-content: center;
1717

18+
h2 {
19+
margin: 0;
20+
font-weight: normal;
21+
}
22+
1823
#close {
1924
display: flex;
2025
justify-content: flex-end;

src/ui/MapModal.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,16 @@ const MapModal: FC<Props> = ({
5151
onRequestClose={() => onClose(false)}
5252
portalClassName={cx('preview', !isLandscape ? 'portrait' : '')}
5353
ariaHideApp={ariaHideApp}
54+
aria={{ labelledby: 'map-modal-heading' }}
5455
>
5556
<div className="mapmodal">
5657
<div className="map-modal-header">
57-
{' '}
58-
{t('select-bounds')}{' '}
59-
<section id="close">
58+
<h2 id="map-modal-heading">
59+
{t('select-bounds')}
60+
</h2>
61+
<div id="close">
6062
<button
6163
className="close-button"
62-
role="button"
6364
aria-label={t('close')}
6465
onClick={() => onClose(false)}
6566
>
@@ -69,8 +70,8 @@ const MapModal: FC<Props> = ({
6970
height={24}
7071
width={24}
7172
/>
72-
</button>{' '}
73-
</section>
73+
</button>
74+
</div>
7475
</div>
7576
<MonitorMapContainer
7677
mapSettings={mapSettings}

src/ui/PreviewModal.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
position: relative;
4141
font-family: $font-family;
4242
font-size: 24px;
43+
font-weight: normal;
4344
line-height: 29px;
4445
letter-spacing: -0.02em;
4546
color: #fff;
4647
width: 540px;
48+
margin: 0;
4749
}
4850

4951
.close {

src/ui/PreviewModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ const PreviewModal: FC<Props> = ({
4848
onRequestClose={() => onClose(false)}
4949
portalClassName={cx('preview', !isLandscape ? 'portrait' : '')}
5050
ariaHideApp={ariaHideApp}
51+
aria={{ labelledby: 'preview-modal-heading' }}
5152
>
5253
<div className="title-and-close">
53-
<div className="title">{t('preview')}</div>
54-
<section id="close">
54+
<h2 id="preview-modal-heading" className="title">{t('preview')}</h2>
55+
<div>
5556
<button
5657
className="close"
57-
role="button"
5858
aria-label={t('close')}
5959
onClick={() => onClose(false)}
6060
>
6161
<Icon img="close" color={'#FFFFFF'} height={16} width={16} />
6262
</button>
63-
</section>
63+
</div>
6464
</div>
6565
<section
6666
id={isLandscape ? 'preview-monitor' : 'preview-monitor-portrait'}

src/ui/StopCardRow.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
max-width: 300px;
155155

156156
.header {
157+
display: block;
157158
padding-bottom: 16px;
158159
margin-left: 2px;
159160
}

src/ui/StopCardRow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ const StopCardRow: FC<IProps> = ({
429429
appElement={'root'}
430430
searchContext={searchContext}
431431
icon="search"
432-
id={'search'}
432+
id={`search-${id}`}
433433
ariaLabel={t('autosuggestPlaceHolder')}
434434
placeholder={t('autosuggestPlaceHolder')}
435435
renderLabel

src/ui/StopListContainer.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const StopListContainer: FC<Props> = ({
5252
return (
5353
<div className="stop-list">
5454
<section
55-
id={'left'}
55+
id={`left-${card.id}`}
5656
aria-label={showStopTitles ? t('leftColumn') : undefined}
5757
>
5858
<div>
@@ -73,7 +73,10 @@ const StopListContainer: FC<Props> = ({
7373
{showStopTitles && leftItems.length === 0 && (
7474
<StopListPlaceHolder text={t('no-stops-selected')} />
7575
)}
76-
<ul className="stops" aria-label={t('added-stops')}>
76+
<ul
77+
className="stops"
78+
aria-label={showStopTitles ? t('leftColumn') : t('added-stops')}
79+
>
7780
{leftItems &&
7881
leftItems.map((item, index) => {
7982
const s = {
@@ -98,7 +101,7 @@ const StopListContainer: FC<Props> = ({
98101
</div>
99102
</section>
100103
{showStopTitles && (
101-
<section id={'right'} aria-label={t('rightColumn')}>
104+
<section id={`right-${card.id}`} aria-label={t('rightColumn')}>
102105
<div className="double-inputs">
103106
{languages?.map(lan => (
104107
<StopListTitleInput
@@ -115,7 +118,7 @@ const StopListContainer: FC<Props> = ({
115118
<StopListPlaceHolder text={t('no-stops-selected')} />
116119
)}
117120
<div>
118-
<ul className="stops" aria-label={t('added-stops')}>
121+
<ul className="stops" aria-label={t('rightColumn')}>
119122
{rightItems &&
120123
rightItems.map((item, index) => {
121124
const s = {

src/ui/StopListTitleInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ const StopListTitleInput: FC<IProps> = ({
3131

3232
return (
3333
<div className="stop-list-title-input">
34-
<div className="header">
34+
<label className="header" htmlFor={`stop-list-title-input-${side}-${lang}`}>
3535
{t(`header-side-${side}`).concat(' - ').concat(lang.toUpperCase())}
36-
</div>
36+
</label>
3737
<InputWithEditIcon
3838
onChange={title => onChange(title, side)}
3939
id={`stop-list-title-input-${side}-${lang}`}

src/ui/StopRoutesModal.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.modal-stop-routes {
2-
h2 {
2+
h2,
3+
h3 {
34
font-style: normal;
45
font-weight: $font-weight;
56
font-size: 18px;

0 commit comments

Comments
 (0)