@@ -329,10 +329,11 @@ const DeclareAbsenceForm: React.FC<DeclareAbsenceFormProps> = ({
329329 ) }
330330
331331 < FormControl isRequired isInvalid = { ! ! errors . subjectId } >
332- < FormLabel sx = { { display : 'flex' } } >
332+ < FormLabel id = "subjectLabel" as = "p" sx = { { display : 'flex' } } >
333333 < Text textStyle = "h4" > Subject</ Text >
334334 </ FormLabel >
335335 < InputDropdown
336+ labelledBy = "subjectLabel"
336337 label = "subject"
337338 type = "subject"
338339 onChange = { ( value ) => {
@@ -352,10 +353,11 @@ const DeclareAbsenceForm: React.FC<DeclareAbsenceFormProps> = ({
352353 </ FormControl >
353354
354355 < FormControl isRequired isInvalid = { ! ! errors . locationId } >
355- < FormLabel sx = { { display : 'flex' } } >
356+ < FormLabel id = "locationLabel" as = "p" sx = { { display : 'flex' } } >
356357 < Text textStyle = "h4" > Location</ Text >
357358 </ FormLabel >
358359 < InputDropdown
360+ labelledBy = "locationLabel"
359361 label = "location"
360362 type = "location"
361363 onChange = { ( value ) => {
@@ -373,29 +375,33 @@ const DeclareAbsenceForm: React.FC<DeclareAbsenceFormProps> = ({
373375 />
374376 < FormErrorMessage > { errors . locationId } </ FormErrorMessage >
375377 </ FormControl >
378+
376379 < FormControl >
377- < FormLabel htmlFor = "roomNumber " sx = { { display : 'flex' } } >
380+ < FormLabel id = "roomNumberLabel " sx = { { display : 'flex' } } >
378381 < Text textStyle = "h4" > Room Number</ Text >
379382 </ FormLabel >
380383 < Input
384+ aria-labelledby = "roomNumberLabel"
381385 id = "roomNumber"
382386 name = "roomNumber"
383387 placeholder = "e.g. 2131"
384388 value = { formData . roomNumber }
385389 onChange = { handleChange }
386390 />
387391 </ FormControl >
392+
388393 < DateOfAbsence
389394 dateValue = { initialDate }
390395 onDateSelect = { handleDateSelect }
391396 error = { errors . lessonDate }
392397 />
393398
394399 < FormControl isRequired isInvalid = { ! ! errors . reasonOfAbsence } >
395- < FormLabel htmlFor = "reasonOfAbsence " sx = { { display : 'flex' } } >
400+ < FormLabel id = "reasonOfAbsenceLabel " sx = { { display : 'flex' } } >
396401 < Text textStyle = "h4" > Reason of Absence</ Text >
397402 </ FormLabel >
398403 < Textarea
404+ aria-labelledby = "reasonOfAbsenceLabel"
399405 id = "reasonOfAbsence"
400406 name = "reasonOfAbsence"
401407 placeholder = "Only visible to admin"
@@ -414,10 +420,11 @@ const DeclareAbsenceForm: React.FC<DeclareAbsenceFormProps> = ({
414420 </ FormControl >
415421
416422 < FormControl >
417- < FormLabel htmlFor = "notes " sx = { { display : 'flex' } } >
423+ < FormLabel id = "notesLabel " sx = { { display : 'flex' } } >
418424 < Text textStyle = "h4" > Notes</ Text >
419425 </ FormLabel >
420426 < Textarea
427+ aria-labelledby = "notesLabel"
421428 id = "notes"
422429 name = "notes"
423430 placeholder = "Visible to everyone"
0 commit comments