Problem/Motivation
Having multiple elements with the same ID causes issues for screen readers.
When a label has a for attribute associated with the date picker.
Steps to reproduce
1. Use a screen reader to read the date picker.
2. The screen reader will not read the text the label is associated with since multiple IDs exist.
Proposed resolution
Use a different ID for the duet-date-picker element and the input element.
Example
<duet-date-picker identifier="after" name="after" id="after" value="2025-03-27" min="2025-03-27" max="2025-04-02" class="hydrated" data-once="duet-date-picker-locale">
<div class="duet-date__input-wrapper">
<input class="duet-date__input" placeholder="YYYY-MM-DD" id="after" aria-autocomplete="none" autocomplete="off" tabindex="-1" data-once="input-typing-handler">
...
</div>
</duet-date-picker identifier>
Comments
Comment #2
sstapleton commentedComment #3
sstapleton commentedComment #6
bbu23This can be solved by overriding the template, but I'm creating a merge request to fix the module's template as well.
As per documentation, it is not recommended to use the
idattribute, but instead to use theidentifier:I'm also removing the label, since my exposed filter already has a label. If this affects other places, then it needs to be addressed, but usually labels should be separate.
Comment #8
classiccut commentedThanks @bbu23!
Comment #9
classiccut commentedComment #11
bbu23Great!
P.S. I would appreciate the contribution record update.
Comment #12
classiccut commentedOf course! My apologies, I thought I had double checked the contribution but I guess I didn't set it correctly. I believe it should be good now, but if it's not please let me know. Thanks!
Comment #13
bbu23Hehe, don't worry!
It looks good now, thank you!