Skip to content

Commit 33383b8

Browse files
author
Sine Jespersen
committed
CMN-293: add screen-reader-description
1 parent 296dc5c commit 33383b8

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/stories/Library/list-buttons/ListButtons.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ export const ListButton: React.FC<ListButtonProps> = ({
1515
}) => {
1616
return (
1717
<div className="dpl-list-buttons">
18+
<div
19+
className="dpl-list-buttons__screen-reader-description"
20+
id="renew-multiple-modal"
21+
>
22+
This button opens a modal that covers the entire page and contains loans
23+
with different due dates, if some of the loans in the modal are
24+
renewable you can renew them
25+
</div>
1826
<h2 className="dpl-list-buttons__header">
1927
{header}
2028
<div className="dpl-list-buttons__power">{number}</div>
@@ -32,7 +40,10 @@ export const ListButton: React.FC<ListButtonProps> = ({
3240
src="icons/collection/Various.svg"
3341
/>
3442
</div>
35-
<div className="dpl-list-buttons__buttons__button">
43+
<div
44+
className="dpl-list-buttons__buttons__button"
45+
aria-describedby="renew-multiple-modal"
46+
>
3647
<Button
3748
label={buttonLabel}
3849
buttonType="none"

src/stories/Library/list-buttons/list-buttons.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,15 @@
3939
display: flex;
4040
}
4141
}
42+
43+
.dpl-list-buttons__screen-reader-description {
44+
position: absolute;
45+
clip: rect(1px, 1px, 1px, 1px);
46+
padding: 0;
47+
border: 0;
48+
height: 1px;
49+
width: 1px;
50+
overflow: hidden;
51+
// Should include "hide-visually", but it doesn't work, I suspect due to import order
52+
// @include hide-visually;
53+
}

0 commit comments

Comments
 (0)