Skip to content

Commit

Permalink
Update setup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jscholes committed Dec 4, 2024
1 parent aae153f commit 74c3b7f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// sets the state of the first radio button to checked, and sets focus on a link after the radio group
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('tabindex', '0');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
testPageDocument.querySelector('#afterlink').focus();
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// sets the state of the first radio button to checked, sets focus on a link before the radio group, and hides the group heading
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('tabindex', '0');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
testPageDocument.querySelector('#beforelink').focus();
testPageDocument.querySelector('#group_label_1').style.display = 'none';
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// sets the state of the third radio button to checked, and sets focus on a link after the radio group
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[2].classList.add('focus');
radios[2].setAttribute('tabindex', '0');
radios[2].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[2].id);
testPageDocument.querySelector('#afterlink').focus();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// sets focus on the first radio button, and sets its state to checked
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('tabindex', '0');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
radioGroup.focus();
radios[0].focus();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// sets focus on the first radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
radios[0].setAttribute('tabindex', '0');
testPageDocument.querySelector('#group_label_1').style.display = 'none';
radioGroup.focus();
radios[0].focus();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// sets focus on the first radio button, and checks the second radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[0].classList.add('focus');
radios[0].setAttribute('tabindex', '0');
radios[1].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[0].id);
radioGroup.focus();
radios[0].focus();
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// sets focus on the second radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[1].classList.add('focus');
radioGroup.setAttribute('aria-activedescendant', radios[1].id);
radioGroup.focus();
radios[1].setAttribute('tabindex', '0');
radios[1].focus();
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// sets focus on the second radio button, and checks the first radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[1].classList.add('focus');
radios[1].setAttribute('tabindex', '0');
radios[0].setAttribute('aria-checked', 'true');
radioGroup.setAttribute('aria-activedescendant', radios[1].id);
radioGroup.focus();
radios[1].focus();
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// sets focus on the third radio button
let radioGroup = testPageDocument.querySelector('[role="radiogroup"]');
let radios = testPageDocument.querySelectorAll('[role="radio"]');
radios.forEach(r => {
r.setAttribute('tabindex', '-1');
r.setAttribute('aria-checked', 'false');
r.classList.remove('focus');
});
radios[2].classList.add('focus');
radioGroup.setAttribute('aria-activedescendant', radios[2].id);
radioGroup.focus();
radios[2].setAttribute('tabindex', '0');
radios[2].focus();

0 comments on commit 74c3b7f

Please sign in to comment.