Add a UUID function to create domIDs for forms and ARIA attributes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
New
|
Undecided
|
Unassigned |
Bug Description
We have a number of accessibility bugs related to form labels and ARIA attributes where we need to reference another element by ID. Angular does not provide a built-in way to access its encapsulation IDs, so we have several methods of generating IDs throughout Evergreen. It would be great to standardize this so that it's easier for devs to use IDs consistently in a way that lets us add labels and ARIA attributes painlessly when we need them.
https:/
Changed in evergreen: | |
assignee: | nobody → Stephanie Leary (stephanieleary) |
Changed in evergreen: | |
assignee: | Stephanie Leary (stephanieleary) → nobody |
Changed in evergreen: | |
assignee: | nobody → Bill Erickson (berick) |
We can also create app-wide unique values with static variables. Something along the lines of:
export class IdGen {
static id = 0;
static next(): number {
return ++IdGen.id
}
}
<span id={{IdGen. next()} }/> <!-- or similar / untested -->