Skip to content

Commit cbdca62

Browse files
authored
Remove aria-describedby from annotation controls (github#41216)
1 parent a294825 commit cbdca62

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

components/lib/toggle-annotations.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,6 @@ export default function toggleAnnotation() {
2222
const annotationButtons = Array.from(document.querySelectorAll('div.BtnGroup button'))
2323
if (!annotationButtons.length) return
2424

25-
if (!document.getElementById('tooltip-inline')) {
26-
const theSpan = document.createElement('span')
27-
theSpan.id = 'tooltip-inline'
28-
theSpan.classList.add('visually-hidden')
29-
theSpan.innerText = 'Render annotations inline with the code sample.'
30-
document.body.appendChild(theSpan)
31-
}
32-
33-
if (!document.getElementById('tooltip-beside')) {
34-
const theSpan = document.createElement('span')
35-
theSpan.id = 'tooltip-beside'
36-
theSpan.classList.add('visually-hidden')
37-
theSpan.innerText = 'Render annotations beside the code sample.'
38-
document.body.appendChild(theSpan)
39-
}
40-
4125
const cookie = validateMode(Cookies.get('annotate-mode')) // will default to beside
4226
displayAnnotationMode(annotationButtons, cookie)
4327

src/content-render/unified/annotate.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ function getSubnav() {
135135
value: 'beside',
136136
type: 'button',
137137
className: 'BtnGroup-item btn btn-sm',
138-
ariaDescribedBy: 'tooltip-beside',
139138
},
140139
['Beside'],
141140
)
@@ -146,7 +145,6 @@ function getSubnav() {
146145
value: 'inline',
147146
type: 'button',
148147
className: 'BtnGroup-item btn btn-sm',
149-
ariaDescribedBy: 'tooltip-inline',
150148
},
151149
['Inline'],
152150
)

tests/rendering/__snapshots__/annotate.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`annotate renders annotations 1`] = `
4-
"<div class="annotate beside"><div class="annotate-header"><header class="d-flex flex-items-center flex-justify-between p-2 text-small rounded-top-1 border-top border-left border-right"><span class="flex-1">YAML</span><div class="BtnGroup"><button name="annotate-display" value="beside" type="button" class="BtnGroup-item btn btn-sm" aria-describedby="tooltip-beside">Beside</button><button name="annotate-display" value="inline" type="button" class="BtnGroup-item btn btn-sm" aria-describedby="tooltip-inline">Inline</button></div><button class="js-btn-copy btn btn-sm tooltipped tooltipped-nw" aria-label="Copy code to clipboard" data-clipboard="1746955726"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-copy" aria-hidden="true"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><pre hidden data-clipboard="1746955726"># The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
4+
"<div class="annotate beside"><div class="annotate-header"><header class="d-flex flex-items-center flex-justify-between p-2 text-small rounded-top-1 border-top border-left border-right"><span class="flex-1">YAML</span><div class="BtnGroup"><button name="annotate-display" value="beside" type="button" class="BtnGroup-item btn btn-sm">Beside</button><button name="annotate-display" value="inline" type="button" class="BtnGroup-item btn btn-sm">Inline</button></div><button class="js-btn-copy btn btn-sm tooltipped tooltipped-nw" aria-label="Copy code to clipboard" data-clipboard="1746955726"><svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-copy" aria-hidden="true"><path d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"></path><path d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"></path></svg></button><pre hidden data-clipboard="1746955726"># The name of the workflow as it will appear in the "Actions" tab of the GitHub repository.
55
name: Post welcome comment
66
77
# Add the \`pull_request\` event, so that the workflow runs automatically

0 commit comments

Comments
 (0)