a11y: associate form labels with inputs (#15)
Month/year/slots selects get ids with matching <label for>; the employee name input, the Excel import file input and the JSON import file input get aria-labels so screen readers announce them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
7ab2911c2f
commit
b3eeca50b3
3 files changed
+9
No files matched your search
@@ -28,8 +28,10 @@ export function renderCalendar() {
|
||||
|
||||
const monthLabel = document.createElement('label');
|
||||
monthLabel.textContent = 'Monat:';
|
||||
monthLabel.htmlFor = 'cal-month';
|
||||
|
||||
const monthSel = document.createElement('select');
|
||||
monthSel.id = 'cal-month';
|
||||
MONTHS.forEach((m, i) => {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = String(i + 1);
|
||||
@@ -40,8 +42,10 @@ export function renderCalendar() {
|
||||
|
||||
const yearLabel = document.createElement('label');
|
||||
yearLabel.textContent = 'Jahr:';
|
||||
yearLabel.htmlFor = 'cal-year';
|
||||
|
||||
const yearSel = document.createElement('select');
|
||||
yearSel.id = 'cal-year';
|
||||
const thisYear = new Date().getFullYear();
|
||||
for (let y = thisYear - 1; y <= thisYear + 2; y++) {
|
||||
const opt = document.createElement('option');
|
||||
@@ -53,8 +57,10 @@ export function renderCalendar() {
|
||||
|
||||
const slotsLabel = document.createElement('label');
|
||||
slotsLabel.textContent = 'Pro Tag:';
|
||||
slotsLabel.htmlFor = 'cal-slots';
|
||||
|
||||
const slotsSel = document.createElement('select');
|
||||
slotsSel.id = 'cal-slots';
|
||||
for (let n = 1; n <= 5; n++) {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = String(n);
|
||||
|
||||
Reference in new issue
Block a user