Skip to content

Commit 2edbae2

Browse files
authored
Update error-empty-button.md
1 parent 568af2e commit 2edbae2

1 file changed

Lines changed: 67 additions & 85 deletions

File tree

docs/known-issues-and-solutions/solutions-index/error-empty-button.md

Lines changed: 67 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ WAVE Tool's Reference material on Empty Button may not specifically address your
3939

4040
## Example of a DOM Snippet Generated From WAVE Tool
4141

42-
```html
43-
<button class="button-0-1-47 outlined-0-1-54 controlButton-0-1-416" type="button" id="edit-about-title-134">
44-
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" color="#0F2940" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" style="color: rgb(15, 41, 64);">
45-
<path fill="none" d="M0 0h24v24H0z"></path>
46-
<path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path>
47-
</svg>
48-
</button>
49-
```
42+
> ```html
43+
> <button class="button-0-1-47 outlined-0-1-54 controlButton-0-1-416" type="button" id="edit-about-title-134">
44+
> <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 24 24" color="#0F2940" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" style="color: rgb(15, 41, 64);">
45+
> <path fill="none" d="M0 0h24v24H0z"></path>
46+
> <path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a.996.996 0 0 0 0-1.41l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path>
47+
> </svg>
48+
> </button>
49+
> ```
5050
5151
5252
## TDM Error guidance
@@ -58,13 +58,14 @@ The following material covers how the TDM team has provided a solution to the Em
5858
- TDM Staging URL: https://tdm-dev.azurewebsites.net/calculation/1/0
5959
- Required User Role: Logged in user
6060
### TDM Calculator Issue and PR details
61-
- Related GitHub Issue(s):
62-
- https://github.com/hackforla/tdm-calculator/issues/2571
63-
- Related Pull Request(s):
64-
- https://github.com/hackforla/tdm-calculator/pull/2602
65-
- React Component(s)
66-
- `client/src/components/Button/NavButton.jsx`
67-
- `client/src/components/Button/Button.jsx`
61+
#### Related GitHub Issue, PR and React Component 1
62+
- Related GitHub Issue 1:
63+
- https://github.com/hackforla/tdm-calculator/issues/2571
64+
- Related Pull Request:
65+
- https://github.com/hackforla/tdm-calculator/pull/2602
66+
- React Component:
67+
- `client/src/components/Button/NavButton.jsx`
68+
- `client/src/components/Button/Button.jsx`
6869
6970
### TDM Solution
7071
@@ -79,65 +80,53 @@ The fix adds an `aria-label` attribute to each icon-only navigation button. This
7980
#### Step-By-Step Guide
8081
<!-- Author Instructions: Replace details dropdown with N/A if this does not apply -->
8182
82-
<details><summary>Click to see step-by-step guide</summary>
83-
<p>
83+
??? Info "Click to see step-by-step guide"
8484
85-
1. Open `client/src/components/Button/Button.jsx`.
86-
2. Ensure the component accepts an `ariaLabel` prop and applies it to the underlying `<button>` element.
87-
3. Open `client/src/components/Button/NavButton.jsx`.
88-
4. Pass a descriptive `aria-label` value based on navigation direction:
89-
- `"project creation previous page"` for the left/previous button
90-
- `"project creation next page"` for the right/next button
91-
5. Confirm through WAVE and screen readers (NVDA/VoiceOver) that each button is now announced correctly.
92-
93-
94-
</p>
95-
</details>
85+
1. Open `client/src/components/Button/Button.jsx`.
86+
2. Ensure the component accepts an `ariaLabel` prop and applies it to the underlying `<button>` element.
87+
3. Open `client/src/components/Button/NavButton.jsx`.
88+
4. Pass a descriptive `aria-label` value based on navigation direction:
89+
- `"project creation previous page"` for the left/previous button
90+
- `"project creation next page"` for the right/next button
91+
5. Confirm through WAVE and screen readers (NVDA/VoiceOver) that each button is now announced correctly.
9692
9793
#### Other Technical Details
9894
<!-- Author Instructions: Write N/A if this does not apply -->
9995
100-
<details><summary>Click to see other technical details</summary>
101-
<p>
96+
??? Info "Click to see other technical details"
10297
10398
[ INSERT OTHER DETAILS e.g. Prop References, Return Value ]
10499
105-
</p>
106-
</details>
107-
108100
#### Code Snippet With Solution
109101
110-
<details><summary>Click to see code snippets...</summary>
111-
112-
113-
```jsx
114-
// client/src/components/Button/Button.jsx
115-
const Button = ({
116-
ariaLabel = undefined,
117-
children
118-
}) => {
119-
return (
120-
<button aria-label={ariaLabel}>
121-
{children}
122-
</button>
123-
);
124-
};
125-
126-
// client/src/components/Button/NavButton.jsx
127-
return (
128-
<Button
129-
aria-label={
130-
navDirection === "previous"
131-
? "project creation previous page"
132-
: "project creation next page"
133-
}
134-
>
135-
{/* SVG icon for left/right navigation */}
136-
</Button>
137-
);
138-
```
139-
140-
</details>
102+
??? Info "Click to see code snippets"
103+
104+
```jsx
105+
// client/src/components/Button/Button.jsx
106+
const Button = ({
107+
ariaLabel = undefined,
108+
children
109+
}) => {
110+
return (
111+
<button aria-label={ariaLabel}>
112+
{children}
113+
</button>
114+
);
115+
};
116+
117+
// client/src/components/Button/NavButton.jsx
118+
return (
119+
<Button
120+
aria-label={
121+
navDirection === "previous"
122+
? "project creation previous page"
123+
: "project creation next page"
124+
}
125+
>
126+
{/* SVG icon for left/right navigation */}
127+
</Button>
128+
);
129+
```
141130
142131
#### Why the Fix Works
143132
<!-- Author Instruction: Add an explanation of how the code changes resolve the accessibility issue and why this approach was chosen -->
@@ -158,40 +147,33 @@ By providing an `aria-label` attribute, the button remains visually unchanged bu
158147
<!-- Author Instructions: when including markdown images, ensure they are responsive by specifying EITHER width OR height. Do not provide both. -->
159148
160149
161-
<details><summary>1. Create Project, Page 1: Empty Button</summary>
162-
<p>
163-
164-
WAVE Error modal on Create Projects Page
150+
??? Info "1. Create Project, Page 1: Empty Button"
165151
166-
> ![Image](https://github.com/user-attachments/assets/941a2b01-f902-414a-a227-927a34217f53)
152+
WAVE Error modal on Create Projects Page
167153
168-
WAVE Error modal on Create Projects Page (styles turned off)
154+
> ![Image](https://github.com/user-attachments/assets/941a2b01-f902-414a-a227-927a34217f53)
169155
170-
> ![Image](https://github.com/user-attachments/assets/83fd0eea-7106-4a85-b438-e72a4d17189b)
156+
WAVE Error modal on Create Projects Page (styles turned off)
171157
172-
</p>
173-
</details>
158+
> ![Image](https://github.com/user-attachments/assets/83fd0eea-7106-4a85-b438-e72a4d17189b)
159+
174160
175-
<details><summary>2. Create Project, Page 1 and Page 4: Empty Button (No Action Required)</summary>
176-
<p>
161+
??? Info "2. Create Project, Page 1 and Page 4: Empty Button (No Action Required)"
177162
178-
Hidden Navigation Buttons
179-
- Note: These buttons have `display: none` and are hidden from assistive technologies. No action required for these instances.
163+
Hidden Navigation Buttons
164+
- Note: These buttons have `display: none` and are hidden from assistive technologies. No action required for these instances.
180165
181-
> ![Image](https://github.com/user-attachments/assets/71bd3cfa-22d9-4c99-89a9-fe6a0a9b8f68)
166+
> ![Image](https://github.com/user-attachments/assets/71bd3cfa-22d9-4c99-89a9-fe6a0a9b8f68)
182167
183-
Same WAVE Icon but also showing Dev Tools Inspector
168+
Same WAVE Icon but also showing Dev Tools Inspector
184169
185-
> ![Image](https://github.com/user-attachments/assets/7e93fc43-4f18-4efd-86e4-cddda94941ca)
170+
> ![Image](https://github.com/user-attachments/assets/7e93fc43-4f18-4efd-86e4-cddda94941ca)
186171
187-
</p>
188-
</details>
189172
190-
<details><summary>3. Visuals After PR changes Were Applied</summary>
173+
??? Info "3. Visuals After PR changes Were Applied"
191174
192-
> <img width="611" height="256" alt="after-label" src="https://github.com/user-attachments/assets/176da5c1-7b48-47db-983b-4cd74dc98fbd" />
175+
> <img width="611" height="256" alt="after-label" src="https://github.com/user-attachments/assets/176da5c1-7b48-47db-983b-4cd74dc98fbd" />
193176
194-
</details>
195177
196178
## Credits/Authors
197179
<!-- Author Instructions: Add bullet points with GitHub handles of all HfLA members who contributed to this wiki page and/or contributed to Pull Requests that provided solutions for this page -->

0 commit comments

Comments
 (0)