Skip to content

Commit 50ff6d5

Browse files
committed
Remove aria-controls from Masodon share button to avoid Axe ambiguity
1 parent b52b46e commit 50ff6d5

3 files changed

Lines changed: 1 addition & 96 deletions

File tree

‎axe-results-incomplete.json‎

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,4 @@
11
[
2-
{
3-
"id": "aria-prohibited-attr",
4-
"impact": "serious",
5-
"tags": [
6-
"cat.aria",
7-
"wcag2a",
8-
"wcag412",
9-
"EN-301-549",
10-
"EN-9.4.1.2",
11-
"RGAAv4",
12-
"RGAA-7.1.1"
13-
],
14-
"description": "Ensure ARIA attributes are not prohibited for an element's role",
15-
"help": "Elements must only use permitted ARIA attributes",
16-
"helpUrl": "https://dequeuniversity.com/rules/axe/4.11/aria-prohibited-attr?application=playwright",
17-
"nodes": [
18-
{
19-
"any": [],
20-
"all": [],
21-
"none": [
22-
{
23-
"id": "aria-prohibited-attr",
24-
"data": {
25-
"role": null,
26-
"nodeName": "highlighter-element",
27-
"messageKey": "noRoleSingular",
28-
"prohibited": [
29-
"aria-label"
30-
]
31-
},
32-
"relatedNodes": [],
33-
"impact": "serious",
34-
"message": "aria-label attribute is not well supported on a highlighter-element with no valid role attribute."
35-
}
36-
],
37-
"impact": "serious",
38-
"html": "<highlighter-element aria-label=\"Share this insight\">",
39-
"target": [
40-
"highlighter-element"
41-
],
42-
"failureSummary": "Fix all of the following:\n aria-label attribute is not well supported on a highlighter-element with no valid role attribute."
43-
},
44-
{
45-
"any": [],
46-
"all": [],
47-
"none": [
48-
{
49-
"id": "aria-prohibited-attr",
50-
"data": {
51-
"role": null,
52-
"nodeName": "section",
53-
"messageKey": "noRoleSingular",
54-
"prohibited": [
55-
"aria-labelledby"
56-
]
57-
},
58-
"relatedNodes": [],
59-
"impact": "serious",
60-
"message": "aria-labelledby attribute is not well supported on a section with no valid role attribute."
61-
}
62-
],
63-
"impact": "serious",
64-
"html": "<section aria-labelledby=\"article-share-title\">",
65-
"target": [
66-
"section[aria-labelledby=\"article-share-title\"]"
67-
],
68-
"failureSummary": "Fix all of the following:\n aria-labelledby attribute is not well supported on a section with no valid role attribute."
69-
}
70-
]
71-
},
722
{
733
"id": "aria-valid-attr-value",
744
"impact": "critical",
@@ -107,28 +37,6 @@
10737
],
10838
"failureSummary": "Fix all of the following:\n Unable to determine if aria-controls referenced ID exists on the page while using aria-haspopup: aria-controls=\"mastodon-modal\""
10939
},
110-
{
111-
"any": [],
112-
"all": [
113-
{
114-
"id": "aria-valid-attr-value",
115-
"data": {
116-
"messageKey": "noIdShadow",
117-
"needsReview": "aria-labelledby=\"article-share-title\""
118-
},
119-
"relatedNodes": [],
120-
"impact": "critical",
121-
"message": "ARIA attribute element ID does not exist on the page or is a descendant of a different shadow DOM tree: aria-labelledby=\"article-share-title\""
122-
}
123-
],
124-
"none": [],
125-
"impact": "critical",
126-
"html": "<section aria-labelledby=\"article-share-title\">",
127-
"target": [
128-
"section[aria-labelledby=\"article-share-title\"]"
129-
],
130-
"failureSummary": "Fix all of the following:\n ARIA attribute element ID does not exist on the page or is a descendant of a different shadow DOM tree: aria-labelledby=\"article-share-title\""
131-
},
13240
{
13341
"any": [],
13442
"all": [

‎src/components/Social/Shares/client/__tests__/index.spec.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ describe('SocialShareElement web component', () => {
164164
expect(mastodonButton).toBeTruthy()
165165

166166
expect(mastodonButton?.getAttribute('aria-haspopup')).toBe('dialog')
167-
expect(mastodonButton?.getAttribute('aria-controls')).toBe('mastodon-modal')
167+
expect(mastodonButton?.getAttribute('aria-controls')).toBeNull()
168168

169169
mastodonButton?.dispatchEvent(
170170
new window.MouseEvent('click', { bubbles: true, cancelable: true })

‎src/components/Social/Shares/client/index.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import { queryMetaDescription, querySocialShareIconMarkup } from './selectors'
1111

1212
const COMPONENT_TAG_NAME = 'social-share-element'
1313
const DEFAULT_NETWORKS = 'x,linkedin,bluesky,reddit,mastodon'
14-
const MASTODON_MODAL_ID = 'mastodon-modal'
15-
1614
export class SocialShareElement extends LitElement {
1715
static registeredName = COMPONENT_TAG_NAME
1816

@@ -118,7 +116,6 @@ export class SocialShareElement extends LitElement {
118116
class="${buttonClassList}"
119117
aria-label="${platform.ariaLabel}"
120118
aria-haspopup=${ifDefined(isMastodon ? 'dialog' : undefined)}
121-
aria-controls=${ifDefined(isMastodon ? MASTODON_MODAL_ID : undefined)}
122119
data-platform="${platform.id}"
123120
data-share="${platform.id}"
124121
data-share-text="${shareText}"

0 commit comments

Comments
 (0)