Currently, in the UI, the checkbox label for purchased items is split into two separate div elements. This causes screen readers to announce the label and the date separately, which can lead to a less fluid experience for visually impaired users. For example, screen readers will announce:
"Purchased."
(Move to the next element)
"9/7/2024, 3:51:13 AM."
This could be improved by passing the dateLastPurchased variable into the Toggle component and using it as part of the checkbox label. Doing so would ensure that screen readers announce the entire label together.
[Megan's suggestion from issue 9 code review]
Currently, in the UI, the checkbox label for purchased items is split into two separate div elements. This causes screen readers to announce the label and the date separately, which can lead to a less fluid experience for visually impaired users. For example, screen readers will announce: "Purchased." (Move to the next element) "9/7/2024, 3:51:13 AM."
This could be improved by passing the dateLastPurchased variable into the Toggle component and using it as part of the checkbox label. Doing so would ensure that screen readers announce the entire label together.