Pearson-Higher-Ed / elements-sdk

Base Styling and Atomic JavaScript Components
MIT License
13 stars 13 forks source link

Corrected errors in use of the aria-describedby attribute. #183

Open ularsth opened 2 years ago

ularsth commented 2 years ago

There's an element in the phone number picker that specifies an aria-describedby attribute with two IDs in it- one for an element that never exists within the component (and which component consumers cannot be expected to know anything about, as this is undocumented) and the other which only sometimes exists (conditional on whether errors have been reported for the input).

This change removes the ID of the element which never exists from the aria-describedby attribute in question and updated that attribute itself to be conditionally rendered according to the same condition as the error message element whose ID it specifies. This ensures that the aria-describedby attribute never actively refers to an element which does not currently exist within the DOM.