Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

Commit cf5d9f3

Browse files
author
Babin Bid
authored
accessibility: add dialog semantics and labels to task modal dialogs (#140)
1 parent 41151d6 commit cf5d9f3

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

client/src/pages/app/TasksPage.jsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,18 @@ const CreateTaskModal = ({ events, onClose, onCreated }) => {
104104
onClick={(e) => e.target === e.currentTarget && onClose()}>
105105
<motion.div
106106
className="modal"
107+
role="dialog"
108+
aria-modal="true"
109+
aria-labelledby="create-task-title"
107110
style={{ maxWidth: 560 }}
108111
initial={{ opacity: 0, scale: 0.95 }}
109112
animate={{ opacity: 1, scale: 1 }}>
110113
<div className="modal-header">
111-
<h2 className="modal-title">Create Task</h2>
112-
<button className="btn btn-ghost btn-sm" onClick={onClose}>
114+
<h2 id="create-task-title" className="modal-title">Create Task</h2>
115+
<button
116+
className="btn btn-ghost btn-sm"
117+
onClick={onClose}
118+
aria-label="Close create task dialog">
113119
<RiCloseLine />
114120
</button>
115121
</div>
@@ -310,11 +316,14 @@ const SubmitTaskModal = ({ task, onClose, onSubmitted }) => {
310316
onClick={(e) => e.target === e.currentTarget && onClose()}>
311317
<motion.div
312318
className="modal"
319+
role="dialog"
320+
aria-modal="true"
321+
aria-labelledby="submit-task-title"
313322
initial={{ opacity: 0, scale: 0.95 }}
314323
animate={{ opacity: 1, scale: 1 }}>
315324
<div className="modal-header">
316325
<div>
317-
<h2 className="modal-title">Submit Task</h2>
326+
<h2 id="submit-task-title" className="modal-title">Submit Task</h2>
318327
<p
319328
style={{
320329
fontSize: "0.82rem",
@@ -324,7 +333,10 @@ const SubmitTaskModal = ({ task, onClose, onSubmitted }) => {
324333
{task.title}
325334
</p>
326335
</div>
327-
<button className="btn btn-ghost btn-sm" onClick={onClose}>
336+
<button
337+
className="btn btn-ghost btn-sm"
338+
onClick={onClose}
339+
aria-label="Close submit task dialog">
328340
<RiCloseLine />
329341
</button>
330342
</div>

0 commit comments

Comments
 (0)