Skip to content

Commit 8c6b949

Browse files
authored
Merge branch 'main' into 120-tech-unit-testing-for-autocomplete-combobox
2 parents 1903876 + 6c4321e commit 8c6b949

16 files changed

+67
-15
lines changed

.github/workflows/push-actions.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
node-version: "20.11.0"
1919
cache: "npm"
2020
- name: Install X11 dependencies for robotjs (needed for unit testing on input-mask tests)
21-
run: sudo apt-get install libxtst-dev libpng++-dev xvfb
21+
run: sudo apt-get install libxtst-dev libpng++-dev xvfb
2222
- name: Install npm dependencies
2323
run: npm ci
2424
- name: Run ESLint
@@ -60,7 +60,7 @@ jobs:
6060
which google-chrome &&
6161
google-chrome --version
6262
- name: Install X11 dependencies for robotjs (needed for unit testing on input-mask tests)
63-
run: sudo apt-get install libxtst-dev libpng++-dev xvfb
63+
run: sudo apt-get install libxtst-dev libpng++-dev xvfb
6464
- name: Install npm dependencies
6565
run: npm ci
6666
- name: Start server and wait for localhost to be available

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"options": {
1818
"tabWidth": 2
1919
}
20+
},
21+
{
22+
"files": ["*.php"],
23+
"options": {
24+
"trailingComma": "none"
25+
}
2026
}
2127
]
2228
}

.swo

12 KB
Binary file not shown.

content/body/form-error-checking.php

+24
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,30 @@
271271
}
272272
</script>
273273

274+
<script type="application/ld+json">
275+
{
276+
"@context": "https://schema.org",
277+
"@type": "WebPage",
278+
"name": "Accessible Form Validation: HTML5 and Custom Approaches",
279+
"description": "Learn how to make form validation and error checking accessible using HTML5 and custom validation methods. Includes code examples and best practices.",
280+
"url": "https://www.useragentman.com/enable/form-error-checking.php",
281+
"mainEntity": [
282+
{
283+
"@type": "HowTo",
284+
"name": "Using HTML5 for Accessible Form Validation",
285+
"text": "You can use just the required and pattern attributes on HTML forms to do client-side validation without JavaScript.",
286+
"url": "https://www.useragentman.com/enable/form-error-checking.php#using-native-html5-validation--heading"
287+
},
288+
{
289+
"@type": "HowTo",
290+
"name": "Using Custom Validation for Accessible Form Validation",
291+
"text": "You can use enable-a11y node package to handle client-side form validation and error messages.",
292+
"url": "https://www.useragentman.com/enable/form-error-checking.php#using-custom-validation--heading"
293+
}
294+
]
295+
}
296+
</script>
297+
274298

275299
<?= includeNPMInstructions("accessibility", [], null, false, [
276300
"needsAccessibilityLib" => true,

content/head/link.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<link id="link-css" rel="stylesheet" type="text/css" href="css/link.css" >
22

3-
<?php // since we are using an example from this page, we need to include the stylesheet from it as well.
4-
include "hero-image-text-resize.php";
3+
<!-- Since we are using an example from this page, we need to include the stylesheet from it as well. -->
4+
<?php include "hero-image-text-resize.php";
55
?>

css/figure.css

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ figure,
66
border: solid 1px #ccc;
77
background: #ffffcc;
88
}
9+
figure:has(.showcode),
10+
[role="figure"]:has(.showcode) {
11+
padding: 0;
12+
}
13+
figure:has(.showcode) code,
14+
[role="figure"]:has(.showcode) code {
15+
max-width: calc(100vw - 40px);
16+
}
917
figure img,
1018
[role="figure"] img {
1119
max-width: 100%;

css/table.css

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
position: -webkit-sticky;
4343
position: sticky;
4444
left: 0;
45+
z-index: 1;
4546
}
4647
.sticky-table__sticky-horiz-heading {
4748
position: -webkit-sticky;

js/test/input-mask.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('Input mask test suite', () => {
146146
},
147147
);
148148
// check screenshot for the selection, should match up - "123-45"
149-
await page.screenshot({ path: 'mouseSelection.png' });
149+
// await page.screenshot({ path: 'mouseSelection.png' });
150150
expect(expectedSelection).toBe(selectedText);
151151
});
152152

@@ -178,7 +178,7 @@ describe('Input mask test suite', () => {
178178
},
179179
);
180180
// check screenshot for the selection, should match up - "6-7890"
181-
await page.screenshot({ path: 'keyBoardSelection.png' });
181+
// await page.screenshot({ path: 'keyBoardSelection.png' });
182182
expect(expectedSelection).toBe(selectedText);
183183
});
184184

keyBoardSelection.png

-153 KB
Binary file not shown.

less/figure.less

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ figure,
88
border: solid 1px #ccc;
99
background: #ffffcc;
1010

11+
&:has(.showcode) {
12+
padding: 0;
13+
14+
code {
15+
max-width: calc(100vw - 40px);
16+
}
17+
}
18+
1119
img {
1220
max-width: 100%;
1321
}

less/table.less

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
[role="rowheader"] {
5353
.sticky();
5454
left: 0;
55+
z-index: 1;
5556
}
5657
}
5758

mouseSelection.png

-153 KB
Binary file not shown.

templates/data/meta-info.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@
8080
"desc": "Many designers will turn off focus styles on web apps. There are better solutions that ensure they appear for only the users that need them."
8181
},
8282
"form-error-checking.php": {
83-
"title": "Accessible Form Error Checking",
84-
"desc": "It is not hard to ensure forms work correctly with screen readers and other technology."
83+
"title": "How to Ensure Accessible Form Validation and Error Checking",
84+
"desc": "Learn how to make your form validation and error checking accessible. Follow best practices to ensure your web forms are compliant with WCAG guidelines and user-friendly for everyone."
8585
},
8686
"form.php": {
8787
"title": "Accessible Form Structure",

templates/includes/documentation-header.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class="enable-flyout enable-flyout__level enable-flyout__dropdown">
305305
}, {
306306
"id": "flyout__link",
307307
"props": {
308-
"label": "Form Error Checking",
308+
"label": "Accessible Form Validation",
309309
"url-slug": "form-error-checking",
310310
"alt": ""
311311
}
@@ -589,7 +589,7 @@ class="enable-flyout enable-flyout__level enable-flyout__dropdown">
589589
"content": [{
590590
"id": "flyout__link",
591591
"props": {
592-
"label": "Form Error Checking",
592+
"label": "Accessible Form Validation",
593593
"url-slug": "form-error-checking",
594594
"alt": ""
595595
}

templates/includes/wcag-audio-table.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
<div class="sticky-table__container" tabindex="0">
12
<table class="compliance-table">
23
<caption>WCAG audio related guidelines</caption>
34
<thead>
45
<tr>
5-
<th scope="col"><span class="sr-only">Requirement</span></th>
6+
<th scope="col" class="sticky-table__sticky-horiz-heading"><span class="sr-only">Requirement</span></th>
67
<th scope="col">A</th>
78
<th scope="col">AA</th>
89
<th scope="col">AAA</th>
@@ -35,4 +36,5 @@
3536
<td><img class="compliance-table__icon" src="images/checkmark.svg" alt="required"></td>
3637
</tr>
3738
</tbody>
38-
</table>
39+
</table>
40+
</div>

templates/includes/wcag-video-table.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<table class="compliance-table">
1+
<div class="sticky-table__container" tabindex="0">
2+
<table class="compliance-table">
23
<caption>WCAG video related guidelines</caption>
34
<thead>
45
<tr>
5-
<th scope="col"><span class="sr-only">Requirement</span></th>
6+
<th scope="col" class="sticky-table__sticky-horiz-heading"><span class="sr-only">Requirement</span></th>
67
<th scope="col">A</th>
78
<th scope="col">AA</th>
89
<th scope="col">AAA</th>
@@ -75,4 +76,5 @@
7576
7677
7778
</tbody>
78-
</table>
79+
</table>
80+
</div>

0 commit comments

Comments
 (0)