From 8bd8aa2aa41155c438e2cf02ab43be94c6017535 Mon Sep 17 00:00:00 2001 From: Jay Giang Date: Mon, 9 Jun 2025 13:13:19 -0700 Subject: [PATCH 1/4] Update lesson-2 and lesson-5 to enhance form validation by standardizing aria-describedby attributes --- docs/learn/lesson-2.mdx | 28 +-- docs/learn/lesson-5.mdx | 539 ++++++++++++++++++++++++---------------- 2 files changed, 332 insertions(+), 235 deletions(-) diff --git a/docs/learn/lesson-2.mdx b/docs/learn/lesson-2.mdx index 03fb874..af2dafc 100644 --- a/docs/learn/lesson-2.mdx +++ b/docs/learn/lesson-2.mdx @@ -65,7 +65,7 @@ These components work together to create accessible, well-structured forms that name="tripDate" defaultValue={formData.tripDate} onChange={handleDateChange} - aria-describedby="tripDateHint" + aria-describedby="tripDate-hint" required /> @@ -162,9 +162,9 @@ Let's add the `TimePicker` input below the `DatePicker` form group: minTime="00:00" maxTime="23:45" step={15} - aria-describedby="startTimeHint" + aria-describedby="start-time-hint" /> - + Please enter or select the time you started fishing. @@ -220,14 +220,14 @@ Add the following code below the `TimePicker` form group: name="startWeather" value={formData.startWeather} onChange={handleInputChange} - aria-describedby="startWeatherHint" + aria-describedby="start-weather-hint" > - + Please select the weather conditions at the start of your fishing trip. @@ -240,7 +240,7 @@ Add the following code below the `TimePicker` form group: - `onChange={handleInputChange}` uses the standard input handler (already present) because the `Select` component behaves like a standard HTML select element in this regard. - We define the available weather options using standard HTML `