Skip to content

Commit a9446fd

Browse files
fix(accessibility): fix sa11y accessibility issue for popover (#5173)
* fix(accessibility): fixed sa11y issue and removed button clicke here. * removed commented lines * removed comments * code refactored. * removed auto formatting. * removed space. --------- Co-authored-by: dugg molidor <[email protected]>
1 parent 5d6f7a4 commit a9446fd

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

ui/components/popovers/base-legacy/example.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,14 @@ export let Popover = props => {
7272
) : (
7373
props.header
7474
)}
75-
<div className={computedBodyClassnames} id={bodyUniqueId}>
75+
<div className={computedBodyClassnames}
76+
id={bodyUniqueId}
77+
{...props.size === "small" && {
78+
tabindex: "0",
79+
role: "region",
80+
}}
81+
>
7682
{props.children}
77-
<button type="button">Click here</button>
7883
</div>
7984
{props.footer ? (
8085
<footer

ui/components/popovers/base/example.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ export let Popover = props => {
6363
/>
6464
) : null}
6565

66-
<div className={computedBodyClassnames} id={bodyUniqueId}>
66+
<div className={computedBodyClassnames}
67+
id={bodyUniqueId}
68+
{...props.size === "small" && {
69+
tabindex: "0",
70+
role: "region",
71+
}}
72+
>
6773
{props.badgeTitle ? (
6874
<div className="slds-popover__meta">
6975
{props.badgeVariant && props.badgeVariant === 'light' ? (
@@ -106,7 +112,6 @@ export let Popover = props => {
106112
)}
107113

108114
{props.children}
109-
<button type="button">Click here</button>
110115
</div>
111116
</div>
112117
</div>

0 commit comments

Comments
 (0)