Problem/Motivation
The datetime and daterange widgets aren't as accessible as they can be. The improper use of the datetime-wrapper compounds the problem with the datarange widget.
Most setting combinations of these result in multi-element inputs for a single filed, with no clear way to represent this in an accessible way. In addition, the datetime-wrapper does not use the proper ARIA references for the help text.
Proposed resolution
- Wrap multi-element date widgets in fieldsets, with the field label as the legend.
- Ensure ARIA description associations are correct.
Remaining tasks
None.
User interface changes
Filesets around multielement date fields, and improved ARIA.
API changes
None.
Data model changes
None.
Comments
Comment #1
mgiffordThe CSS definitely needs work, but it's built against Core (now) using the example I provided in comment #141 of the parent issue.
Oh ya, there is another issue looking to remove fieldsets and I'm looking for clarification on that #1467712-97: Make it possible to disable fieldset for date field
So far all that's been described is formatting problems (which can be fixed with CSS).
Comment #3
swentel commentedMoving to right component
Comment #4
mgifford#1: fieldsets-with-date-1918994-1.patch queued for re-testing.
Comment #5
mgiffordSeems to work fine in simplytest.me.
Comment #6
mgifford#1: fieldsets-with-date-1918994-1.patch queued for re-testing.
Comment #7
mgifford#1: fieldsets-with-date-1918994-1.patch queued for re-testing.
Comment #8
andymartha commentedOk, so this patch does nothing for the ui (?) but is for accessibility. After applying patch fieldsets-with-date-1918994-1.patch from mgifford in #1 on a fresh install of Drupal 8, it applies a fieldset and legend to date select lists on a content create/edit screen. Correct me if I'm wrong but it seems like it works well. See screenshots below for markup.

Comment #9
mgiffordThanks @andymartha - that looks good to me, but I wrote the patch.
Not sure what else would be involved for it to be RTBC. Seems like it's already a strong pattern now in D8 to wrap elements like this in fieldsets.
Comment #10
andymartha commentedI am switching the status to reviewed if the patch is supposed to change the markup for fieldsets, which I confirm it does.
Comment #11
Bojhan commentedCan we use the invisible fieldset styling here?
Comment #12
mgiffordUntil this patch gets in Core, this will need to be applied with http://drupal.org/files/cardinality-label-1932074.38.patch
Or, this would need to be added:
Comment #13
mgiffordWell, this should work. I get this output:
And the CSS is there and it's working fine in the related patch.
Unless core/modules/field_ui/field_ui.admin.css isn't loaded when not administering a field....
In which case this CSS should be moved somewhere else.
Comment #14
Bojhan commentedStrange, I have no idea why system would overwrite it there. Perhaps system should provide a class for this too?
Comment #15
cwarsaw commentedI have reviewed this patch. I verified that before the patch, the fieldset is not there. I verified after the patch is applied, the fieldset is there correctly. I verified this patch with both the Date and Time widget and the Select List widget. See attached images.
I have also confirmed that the border is visible. If the intention is for there to be no border, then this is a separate CSS issue.
Since that doesn't impact the accessibility of this control, I don't believe that should prevent this patch from being committed to core.
Comment #16
mgiffordThat CSS is going to be provided by #504962: Provide a compound form element with accessible labels - so I don't see any reason not to mark this RTBC.
@cwarsaw want to mark this RTBC?
Comment #17
mgifford#12: fieldsets-with-date-1918994-12.patch queued for re-testing.
Comment #19
mgiffordtagging
Comment #20
mgifford#12: fieldsets-with-date-1918994-12.patch queued for re-testing.
Comment #22
mgiffordI've rerolled the patch, but is there only one date widget now? Could only see one here:
admin/structure/types/manage/article/fields/node.article.field_date/field
Comment #23
mgifford#22: fieldsets-with-date-1918994-22.patch queued for re-testing.
Comment #24
bowersox commentedComment #25
mgifford#22: fieldsets-with-date-1918994-22.patch queued for re-testing.
Comment #27
jessebeach commentedSee #2084599: The 'authored on' vertical tab form items should be wrapped in a fieldset for an additional example.
Comment #28
nod_Why all the selects to begin with? #1496652: Add new HTML5 FAPI Element : datetime-local
Comment #29
falcon03 commentedOk, maybe this issue could be fixed with a patch as simple as this one.
I've tested it in Voiceover and it improves accessibility for both the standard widget and the select list widget.
However, we have a problem when multiple values can be entered in the field. The uix for a screen reader user in that case is pretty bad. But, maybe fixing that is out of scope for this issue (the problem is not introduced by this patch).
Comment #30
mgiffordUnfortunately this patch changes the styling.
Without the patch the date/time are right next to each other:

But with the patch it's clearly in a fieldset.

That still needs #1932074: Tags Includes Label which isn't Associated with an Input Form to pull in the CSS to see that this isn't styled.
Comment #31
falcon03 commented@mgifford, would leveraging the css class eventually introduced by #2002336: Introduce a CSS class to hide borders of fieldset elements be enough to solve the styling issues?
Comment #32
aaronbaumanAdding concerns via #1467712: Make it possible to disable fieldset for date field:
If the input is actually one field, it should not be wrapped in a fieldset.
#22 accomplishes this, i think, but #29 always forces the input to be wrapped by a fieldset.
Comment #33
mgifford@aaronbauman - Yes, #22 did check for multiple fields before applying the fieldset. I do think this is a lot harder to do though with twig. Not that this doesn't mean it shouldn't be done with twig.
It might just be cleaner if rather than trying to do the logic in twig, we simply have datetime-single-wrapper-html.twig & datetime-multiple-wrapper-html.twig.
I'm not familiar with how to do this. $element['#date_time_element'] & $element['#date_date_element'] are the only elements we need to consider. If they are both there, it should be wrapped in a fieldset.
I think
#date_date_element = 'datetime';produces more than one field mind you.@falcon03 - I think so. I added it here and am testing on STM. Next post should include a screenshot.
Latest patch just includes the problematic code from #29 with
<fieldset class="fieldset-no-border">plus the CSS to style it.Comment #34
mgiffordI didn't notice this before, but this patch also produces a fieldsets inside of fieldsets. That's obviously not what we want.
That being said, I think that with the CSS applied, it looks right:
Comment #35
mgiffordBot didn't seem to run earlier.
Comment #37
mgiffordre-roll.
Comment #38
mgiffordLegend needs to match labels
<legend class="label"> date </legend>The legend doesn't match the styling of the labels:

Comment #39
mgiffordMuch simpler...

Comment #40
tim bozeman commented@mgifford I brought the changes from #2244923: The help text for datetime field needs an ID for screen readers. and closed the issue. Thanks again for walking me through #2126761: The body field summary textarea indicates it has a description with aria-describedby attribute, but the DOM id value points to a non-existent node!
The additions to this patch:
Comment #41
tim bozeman commentedThis change adds the aria-describedby attribute to the fieldset
<fieldset class="fieldgroup form-composite"{{ attributes }}>with an else on line 249 of datetime.module, but I'm not sure its the best way to do it.Comment #43
mgiffordGetting closer! It's giving me some confusing results though. Fieldsets within fieldsets.
No aria-describedby="" in the first one, but there in the second.
I didn't see that duplicate previously, but could have missed it....
Comment #44
tim bozeman commentedHmm, I went back to patch #39 and it looks like there was double fieldsets there too. My guess is that both the date and time field are hitting datetime-wrapper.html.twig twice as rendered elements (content).
Comment #45
mgiffordThat makes sense...
We can dig into this a bit further. If we can't get the duplicate resolved we can move the aria-describedby issue back to #2244923: The help text for datetime field needs an ID for screen readers. and reopen it.
Comment #46
tim bozeman commentedThe date in the Authoring Information section on the right isn't in a double fieldset. Why is that one different from the content type field?

Comment #47
mgifford@Tim Bozeman I'm guessing that the authoring information doesn't leverage the datetime.module
It would make sense that it does, but apparently........
Also interesting, set up a date field with 2 or more date options in it. It then has the duplicate fieldsets for each row of date fields (4 or more) but only a single description field.
With multiple values the aria-describedby needs to be in the table field-date-values table or maybe
<h4 class="label">Date</h4>Definitely have to dig into the datetime.module more though.
EDIT: The description for multi-part forms comes out in core/modules/system/templates/field-multiple-value-form.html.twig
Comment #48
tim bozeman commentedThere doesn't seem to be a way to delete a row of dates...
I added the aria-describedby to the table field-date-values. I'm not sure what to do about the fieldset. Cottser suggested using a general form field wrapper instead of a date-specific wrapper.
Comment #49
tim bozeman commentedCottser said to use a more general #theme_wrapper in DateTimeDefaultWidget.php The results are pretty magical IMO.
Comment #51
mgiffordLooking great for a single date element. It gracefully degrades for multiple date elements. I think you've got it! I think if we can work through the test this should be good. I think we should deal with more complicated multiple date options in a different issue. It's an edge case for the most part.
EDIT: Pretty neat patch btw. Oh ya, we should eliminate the boundary. Also, we should be using the CSS class fieldgroup so that it doesn't have the border.
Comment #52
tim bozeman commentedI googled what this line of DateTimeFieldTest.php:101 is doing.
$this->assertFieldByXPath('//*[@id="edit-' . $field_name . '-wrapper"]/h4/span', '*', 'Required markup found');It seems that Xpath is some xml element grabbing thing and its looking for the associated h4 or span? I removed that line from the test and it seems to pass simple test. I wonder if it's important...
Comment #54
mgiffordThis patch doesn't actually add the fieldgroup with
'#attributes' => array('class' => array('fieldgroup')),it really should.I'm hoping this fixes the bot's concerns by changing where the tests are looking:
$this->assertFieldByXPath('//*[@id="edit-' . $field_name . '-wrapper"]/fieldset/legend/span', '*', 'Required markup found');Comment #56
tim bozeman commentedShould I wrap the field-group in an if type == datetime ?
Comment #58
tim bozeman commentedhmm...

looks like it should be working to me :(
Comment #59
tim bozeman commentedThe test originally said
It had an extra span tag so I added an extra span too and it passes simple test locally.
Comment #60
mgiffordThat's great progress! The tests pass.
Now how do we deal with the styling so that there's no box around it?
fieldgroup removes it, but it also makes the title ALL CAPS.
It's also not clear to me how to pass this attribute through.
Comment #61
tim bozeman commentedI added the field-group class to the fieldset tag in DateTimeDefaultWidget.php:59 the CSS acting on it is
in normalize.css. If you disable it a thicker border shows up. I don't see a good attribute to grab to over-ride the rule.
Comment #62
mgiffordOk, this works for datetime, but if you choose just date in the Field settings, there shouldn't be a fieldset admin/structure/types/manage/article/fields/node.article.field_date/field
Fieldsets shouldn't be wrapping a single element.
Comment #63
sunThe theme hook for fieldsets is registered by System module already, and we should be able to re-use the #pre_render callback of #type radios/checkboxes here.
At least I hope so. :-)
Comment #64
tim bozeman commentedI don't see how to re-use the #pre_render callback of #type radios/checkboxes.
I read through ElementInfoInterface::getInfo and I see that form_pre_render_conditional_form_element adds the fieldset like we want.
How do we only wrap datetime and not just date by itself? I studied how radios and checkboxes work in system_element_info(), but throw in DateTimeDefaultWidget.php and I can't seem to connect the dots.
I want to add
$types['date']to datetime_element_info(), but it starts making duplicate fields.Comment #65
mgiffordSo we've got two use cases here. One needs fieldsets (date & time) one doesn't (date only). Both need to address the aria-describedby issue of linking the help text to the Label or Legend. With the existing patches we've been working with, I think this combination works.
Comment #67
tim bozeman commented@mgifford nice!!
The date only field was missing the aria-describedby attribute so I added it to template_preprocess_container()
Should we add another date only field to DateTimeFieldTest.php?
Comment #68
mgiffordYes.. We'd want the "add another date only field to DateTimeFieldTest.php"
Can you take that on?
Glad you found the template_preprocess_container() to add the aria-describedby.
Comment #69
mgiffordComment #70
tim bozeman commentedYep, I'll try adding the test field :)
Comment #72
tim bozeman commentedThe patch didn't apply so I rerolled it.
I think this patch does what we need it too and passes simpletest, but the test doesn't reflect the changes.
DateTimeFieldTest.php:65 sets the type as
'settings' => array('datetime_type' => 'date'),which I think hits the switch statement DateTimeDefaultWidget.php:61case DateTimeItem::DATETIME_TYPE_DATE:which sets the theme_wrapper to datetime_wrapper. That is allowing the test:101 line$this->assertFieldByXPath('//*[@id="edit-' . $field_name . '-wrapper"]/h4[contains(@class, "form-required")]', TRUE, 'Required markup found');to find the label under the h4. Since this test is testing date + time it should be looking under /fieldset/legend/span, but again because the datetime_type is set to date it's hitting the wrong wrapper.I tried to change datetime_type to datetime, but I get AJAX errors when I run the test.
I tried adding
case DateTimeItem::DATETIME_TYPE_DATETIME:to the widget. Doesn't help...Comment #73
tim bozeman commentedComment #74
mgiffordIt's looking good from an output perspective.. I do think it's worth adding the
display: block;so that the help text starts on a new line:The aria-describedby looks great and it's all wrapped properly in a fieldset. I wonder who we could get to help improve the tests....
Comment #75
tim bozeman commentedWhen in doubt Cottser out. I brought it up during office hours and Cottser walked me through simpletesting.
Comment #76
tim bozeman commentedOkay, I guess the test was closer than I thought. ¯\_(ツ)_/¯
I added this to DateTimeFieldTest.php:173 and I think that it covers all the changes from the patch.
EDIT: @mgifford The help text seems to be showing up on a new line. I had to clear caches before to get them to show up right.
Comment #77
mgiffordSo close... Unfortunately, the aria-describedby property in the Date only implementation (of a date field) doesn't line up.
<div id="edit-field-date2-wrapper" class="field-type-datetime field-name-field-date2 field-widget-datetime-default form-wrapper" aria-describedby="edit-field-date2--description"><div id="edit-field-date2-0--description" class="container-inline description">helpful date</div>Comment #78
tim bozeman commentedYes, that's not right... Hmm
Comment #79
tim bozeman commentedFor a single date field the output matches now.
and for date + time
Comment #80
mgiffordLooks good. I do think we need to address when we have multiple items in a separate issue. For now though, dates are good!
EDIT: Followup issue added here #2273671: Allowed number of values more than 1 needs aria-describedby Support
Comment #81
xjmReroll for #2247991: [May 27] Move all module code from …/lib/Drupal/… to …/src/… for PSR-4.
Comment #83
mgiffordComment #84
mgiffordComment #85
mgiffordI was having trouble posting this today.. I also re-rolled it on the plane. Hopefully the bot likes it better.
Comment #86
tim bozeman commentedPatch applies and the new attributes seem honky dory still.
Comment #87
alexpottThe changes here seem to be more far reaching than just date - can we confirm that we are only affecting what we think we are.
Comment #88
tim bozeman commentedThe line
if (isset($element['widget'][0]['#attributes']['aria-describedby'])) {is true for the title and tags field as well.Comment #89
tim bozeman commentedComment #90
tim bozeman commentedI don't think the container is the right place to put the ARIA
Comment #91
tim bozeman commentedComment #92
mgifford@Tim Bozeman - to try to move this issue along, I've taken out the essential aria stuff that was showing up where it shouldn't have been.
This is a slightly simpler patch that is really just building on your work. It will leave us in a good place to insert ARIA when we know where we want to insert it. Possibly even in a separate issue.
Here's a screenshot:
Comment #93
tim bozeman commentedApplies and sounds good to me. The patch changes the wrapper template to use a fieldset.
Comment #94
alexpottBut this not a conditional form element.
Comment #95
tim bozeman commentedI removed the form_pre_render_conditional_form_element and added an extra template and preprocess function for date + time.

Date
Date + Time

Comment #96
mgiffordComment #97
mgiffordI've got this up here for the sprint - http://se46427db0c1bf5b.s2.simplytest.me/
The date field here - http://se46427db0c1bf5b.s2.simplytest.me/node/add/article - shows the outline from the fieldset. We don't want to add this visual change.
Other than that it is working well.
Comment #98
tim bozeman commentedI added a rule to seven's style.css to hide the fieldset border.
Comment #99
mgiffordThat didn't apply for me.. Just rerolling with your css.
Comment #106
tim bozeman commentedPoor testbot.
reroll of #98. I opened up the patch and added /css to the style path. Passes simple test locally.
Comment #108
tim bozeman commentedI don't get it... PDO exceptions and stuff? The fails seem like they are unrelated to this patch.
Comment #110
tim bozeman commentedComment #111
tim bozeman commentedThe aria-describedby still needs to go on the date only field. Can we add it to the h4 or the div .container-inline? If we add it to #edit-field-date-time-wrapper div we have to go into template_preprocess_container() and, as alexpott pointed out, touch things that we don't intend to.
Or we could (dare I say?) add an extra wrapping div in datetime.wrapper.html.twig
Comment #112
tim bozeman commentedI brought this up at core mentoring. No one likes the idea of adding templates. There's got to be a way to use a more general wrapper in the widget for date + time.
Comment #113
mgiffordAdding a div to the templates isn't the same as adding a template as far as I'm concerned.
What would it look like if we put in another div in datetime.wrapper.html.twig?
These are crappy examples, but thought I'd put it here to see where it goes:
In the scheme of things, not having the aria-describedby is much less important than not having the fieldset for the dates.
Comment #114
tim bozeman commentedMakes sense to me!
Comment #115
tim bozeman commentedAre we simply changing datetime-wrapper.html.twig to out put fieldsets or are we still trying to conditionally wrap date+time in fieldset and have date in a div like it is now?
It is still difficult to implement conditionally. The template it hit twice for every field rendered.
I guess that's the wrapping part? Double hitting the tpl for one element confuses me. I don't see how to get the title and description inside the fieldset with the content.
Comment #116
mgiffordI think we're going to have to address this in 8.1.
Comment #117
mpdonadioProbably. All of these old issues need to be gone through and reevaluated. On my todo list.
Comment #118
mgiffordComment #119
mgiffordRe-uploading for the bots.
Comment #121
mpdonadioComment #122
mpdonadioThis may need to be postponed on #2161337: Add a Date Range field type with support for end date and #2632040: [PP-1] Add ability to select a timezone for datetime field.
If it doesn't, I would love to get this going again. Those two patches are going to make the field widget a mess.
Comment #123
r.nabiullin commentedRerolled patch https://www.drupal.org/node/1918994#comment-9060061
Comment #125
mpdonadioLooks like a bad re-roll. The patch went from about 9k to 49k.
Also changing this to a task, as there is no real bug to fix here.
Comment #127
rteijeiro commentedThis is an attempt to re-roll this patch. I think it still needs some work. There are things that seem to be wrong but this is the best I can do right now.
Comment #129
jessebeach commentedPatch looks good. Just get it to pass tests and we'll be gtg.
Comment #130
vprocessor commentedComment #131
vprocessor commentedHello guys,
diff & patch is ready
Comment #132
andypostlooks there's no BC possible
that requires change record
Comment #134
vprocessor commentedchecking error
Comment #135
andypostFailed tests
this should be copied to Stable theme
Comment #136
vprocessor commentedok, will do that
Comment #137
vprocessor commenteddone
Comment #138
mpdonadioI find the fieldset legend + the label on the input weird, but will defer to our UX/A11Y crew.
Also, patch doesn't seem to work with date-only versions of datetime fields.
Comment #139
jessebeach commentedDiff looks like it should produced the desired HTML. Could you just post a chunk in a comment for an example fieldset?
My head isn't in the nitty-gritty of Drupal theming code. Can someone who is more familiar with this bit just 'lgtm' on the PHP/Twig changes?
Comment #140
mpdonadio#139 screenshot is from Seven on node add page, from a fresh install of 8.2.x.
Comment #141
jessebeach commentedFrom #138: "Also, patch doesn't seem to work with date-only versions of datetime fields."
Needs to be investigated.
Comment #142
yoroy commentedThe issue summary is lacking a reason why. Linking to long overview articles elsewhere doesn't count :-)
Screenshot in context:
I did make the typo in that description but did not enter it twice. That doesn't happen in my d8 install without this patch so needs work there too.
Similar to #138, I think that fieldset legend + form label duplicating eachother looks bad. Even more when the field is required:
Comment #144
xjmThis is actually an accessibility bug.
Comment #145
mpdonadioBumping this to Major because it now blocks #2161337: Add a Date Range field type with support for end date.
Comment #146
mpdonadioReroll b/c #2546248: Use consistent style to mention HTML tags in code comments. Minor merge conflict in core/modules/system/templates/fieldset.html.twig
Comment #147
mpdonadioHere is a start.
Comment #149
jessebeach commented@yoroy, I totally agree with your comment in #142. That double labelling is not ideal! There's a way around this. The output HTML will look something like this (in pseudocode):
We use
aria-labelledbyon the individual inputs to composite a label, referencing the text of the legend and the input itself (a self-referencing label), yielding an accessible label like: "Event start, date, edit text"Comment #150
jhedstromCan somebody please update the issue summary with the exact fix needed? As @yoroy mentioned in #142, linking off to articles doesn't make clear what the proposed solution is.
Comment #151
jessebeach commentedComment #152
mpdonadioWhy remove the label elements for the inputs all together instead of having them invisible (like it currently is)? All of the links in the IS reference labels as being important.
Comment #153
mpdonadioFew more related questions. Are we fixing datetime.module field widgets (the default one and/or the select list) and/or the datetime form element (what DateTimeDefaultWidget builds upon and can also be used in forms in non-field contexts) and/or the datelist form element (what DateTimeDatelistWidget builds upon)?
Are we not doing anything with date-only fields?
With the field widgets, how will these work with multi-valued fields?
IS still needs some TLC: we have a proposed solution but we don't have a clear explanation of what is wrong (why isn't the current implementation accessible?). Not trying to be a pain here, but this issue is hard and soft blocking a lot of other work right now.
Comment #154
mpdonadioThis is also mentioned in #2788359: datetime_wrapper improperly applied to DateTimeWidgetBase; I am fine with scoping this issue to also address that if we can address this in a timely manner. Review is against #146
These hunks show the basic problem with the current patch; a lot of the other code in the patch is working around this: 'datetime_wrapper' is being applied to both the widgets and the form elements.
In this HEAD, DateTimeWidgetBase adds 'datetime_wrapper' to the $element. The in the patch, either 'datetime_wrapper' or 'datetime_fieldset_wrapper' will also be added by DateTimeDefaultWidget. Then the form elements themselves will also get a 'datetime_wrapper' from '#type' => 'datetime' (part of HEAD). Then there is code to try to attempt to fix up the problems introduced by all of these wrappers. This get really ugly when the field is configured to allow multiple values.
In short 'datetime_wrapper' and 'datelist_wrapper' are meant for the form elements and not the widgets. But, I am starting to think that a proper solution means taking care of this and needing proper handlesMultipleValues() support. I would love a Field API maintainer to weigh in here.
We are introducing a theme implementation system wide and only using it inside a particular module. If we need a new theme implementation to address this problem, then it should be defined by the module.
Comment #155
sjpeters79 commentedHey,
I've tried the most recent patch and am having issues modifying the labels on the date field. I thought this patch would have made the labels accessible and modifiable via hook_form_alter but I can't seem to find exactly where in the form object it would be in.
I've tried changing various title within my field to the label that I want it to be but no luck. Any help would be appreciated.
Comment #157
mgiffordRealized the example didn't include a label for each input form. Just adds to the confusion.
Comment #158
mpdonadioClosed #2788359: datetime_wrapper improperly applied to DateTimeWidgetBase as dup of this, since that has been identified as having accessibility issues and it would be counterproductive to work on that and then again on this. Going to post a fresh-start patch later tonight that we can evaluate next steps on.
Comment #159
mpdonadioThis is my proposal for a fresh-start.
Datetime:
Daterange:
It gets rid of the double wrapper problem I described earlier. It uses a fieldset around multi-element fields, and no wrapper around datetime/date-only.
And @mgifford reminded me that I can run WAVE myself :) No WAVE errors or alerts on these elements.
So, right now the patch leverages all of the existing theme elements, has minimal impact, and we don't have any WAVE errors. What else do we need?
Does someone want to take a stab at the IS update to properly describe what the accessibility problems with these in HEAD are? HEAD doesn't have WAVE errors or alerts on these either.
DateTimeFieldTest and DateRangeFieldTest come up green locally, so I expect this to pass. But, I am leaving the Needs Tests tag as we probably want to add some additional coverage to prevent regressions.
Note, I already rolled the patch and spent a while doing the screenshots and comment here. If we like this approach, the patch needs to be tweaked to wrap datetime/date-only+datelist widget in a fieldset. It doesn't currently.
Comment #160
mgiffordWell, that looks like it does the trick. I took the output and then formatted it and it looks good to me:
I definitely like this approach.
TODO
Comment #161
mpdonadioRearranged things a bit to avoid undoing work in base classes. datetime/date-only/datelist should be in a fieldset now.
When I ran WAVE this morning, it detected an error on datetime/date-only/datedefaut. I had to adjust the datetime-wrapper Twig to do this. @davidhernandez did a quick eyeball on the change, and thought it was OK b/c there is no removed functionality but suggested a small CR to announce the change to Classy.
Working on tests next.
Comment #162
mpdonadioInterdiff goodness.
Comment #163
mpdonadioOK, test coverage for the fieldsets and the ARIA. I think this is ready for review. If this approach is OK with everyone, I will draft a short CR to announce the Classy addition.
Comment #164
sugaroverflow commentedWe are triaging this issue @cilefen
Comment #166
cilefen commentedComment #167
mpdonadioLet's post the right patch this time.
Comment #168
mpdonadioPer agreement in #160, here are some IS updates to outline the latest patch.
Comment #169
xjmComment #170
jhedstromThe code is looking really good. This is still tagged for both usability and accessibility review though. @mgifford are you signed off on the latest patch for accessibility?
Comment #171
mgiffordLooks great to me. Structurally this is a big improvement. Tested 1 & 2 dates.
Also tested the optional date range module. I like that the fieldset encompasses both the start date and the end date.
This should be good to go. Anything else needed for it to be RTBC? I think it's good to go.
Comment #172
mpdonadioSince the aim of this issue was accessibility, and we are leveraging existing templates, I am not sure we need anything else. I will draft the CR tomorrow to announce the the change that primarily impacts Classy. Someone can then set RTBC if they desire.
Comment #173
jhedstromOnce the change record is added, I think this is RTBC. Thanks everybody!
Comment #174
mpdonadioTook a stab at the CR.
Comment #175
jhedstromChange record looks good to go! I think this is ready!
Comment #176
yoroy commentedI agree with removing the "needs usability review" tag ;-)
Looking at the screenshots: is "date-only" (with the dash between the two words) correct English?
Comment #177
mpdonadio#176, those are my field labels that were configured from the UI so I could keep everything straight. That string is not in the patch as user facing. The term 'date-only' does appear in the patch as a code comment, but it is consistent with how we document that particular setting (it appears 17 times in 8.4.x HEAD).
Comment #178
yoroy commentedAh ok, thank you. Lets get this in :)
Comment #180
mpdonadioI don't know why #146 got re-triggered by someone, and I can't cancel the run.
The RTBC version of the patch is in #167 (labeled 1918994-163.patch b/c some cross-posting).
Comment #182
drummI put in a retest of #167, which should get RTBC retesting back into place.
RTBC retesting’s choice of what to retest is a bit naive - for each issue, it looks for the most-recently-updated test, and requeues if updated over 24 hours ago. There must have been a DrupalCI disturbance that got some jobs running out of order around February 8.
Comment #183
mpdonadioOk, 8.3.0-beta1 is out, and this is still RTBC. This patch is insanely important to datetime_range staying in core (it solves one of the two remaining core gates) and also blocks much of the work on datetime and daterange, so I am requesting consideration for 8.3.0-RC
Comment #184
xjmThanks @mpdonadio. Today the committers agreed that we are no longer going to do an RC target triage process, and instead just going to use our best discretion about what we backport when. However, I was already thinking about whether this issue was backportable during RC. I think this issue got missed for two reasons in our release management for the past month:
So moving to 8.4.x for now actually. :( I'll ping some theme system maintainers to see if they have time to evaluate this issue and whether we could safely backport it to a release candidate given the importance.
Comment #185
mpdonadioTo be brutally honest, I don't care anymore if this gets into 8.3.0. We just need to get this in so we can unblock work and complete the action plan to keep datetime_range in core and also keep moving forward on other work. This is a triaged D8 major that has been RTBC for nearly a month, so I don't see why we can't do that.
This is essentially the same problem as #2788359: datetime_wrapper improperly applied to DateTimeWidgetBase that sank #2161337: Add a Date Range field type with support for end date in the first place. The clock has been ticking on #2788253: Plan for DateTime Range experimental module, but because of the very limited bandwidth of the UX/A11Y/Theme/Etc framework managers, patch review on the core gates (which have also been blocking other work) have sat for a very long time. That combined with the perpetual randoms in Nov/Dec have severely impacted progress.
I am extremely worried that further delays are going to mean that #2788253: Plan for DateTime Range experimental module won't be completed. Yes, I know that deadline is 2017/08/14, but given weeks between reviews, that time is going to go quickly.
Comment #186
xjm@mpdonadio, I'm definitely concerned also. I agree the most important thing is to just get it committed when possible.
Maybe your question is rhetorical, but I'm going to answer it just in case, since you've done great work on this and other DateTime issues that absolutely deserved prompt feedback they did not get. Unfortunately, committers also have limited capacity. :( There has been really unprecedented RTBC workload this past month, nothing like it since 8.0.0 I think, and in addition to that we have lost around 20% of our sponsored committer hours recently.
I've tried to fill some of the RTBC queue resource gap myself by spending a lot more time on the RTBC queue than I usually do (and let some other high-priority stuff slip because of it), but I also have a minor to ship and etc. And other committers are not paid full-time. We're also trying to add new resources, but it takes time to do that too. Plus, all those random test failures that have messed with so many issues, committers also have to try to manage that problem as well. And so on.
Speaking for myself, this patch is totally outside my expertise, and on top of that contains the one kind of change I mostly know I'm not supposed to commit for theme stuff without knowing what I'm doing which is Classy and Stable changes.
When committers can't keep up with the RTBC queue, the stuff that gets backlogged is stuff that's hard. Stuff that's taken a whole lot of work, like this issue. Stuff that's just simply a lot of code, like the Views issue. Stuff that we're less comfortable with. (I'm sure I don't have to tell you that datetime stuff is complex.) So something like a simple refactoring, I can handle quickly to reduce the overall burden of the queue, because code is code. And I try to help with things like that in the hope that someone else will have the capacity to help with things like this since I'm a theme-challenged. Hopefully someone else can soon.
Comment #187
mpdonadioThanks @xjm; sorry if that came off as a rant. It was more that I don't want to hold this up on debate vs 8.3.0 or not. I know the RTBC queue got backlogged quite a bit.
Comment #188
lauriiiIn overall, the latest patch looks great and is a great improvement for the accessibility!
However, this is a BC breaking change, which would break any custom implementation of this template. I propose that instead of making description an array, we create a new variable called description_attributes.
Comment #189
mpdonadioOK, who needs to review this again when I post a patch later and adjust the CR?
Comment #190
lauriiiI'm happy to do some more reviews on this :)
I just noticed that we should also add the wrapper to the template in the system module. That ensures themes not extending classy can benefit from this accessibility fix.
Comment #191
mpdonadioOK, #188 and #190 should be addressed. Adjusted CR. Spot checked in WAVE, both with the fieldset and w/o it. Think this is good to go.
Comment #192
lauriiiThanks for the fixes @mpdonadio!
We should remove the class from system module. Modules shouldn't contain any classes.
Let's remove all changes from the stable module. Stable is a BC layer protecting existing sites to ensure that there are no markup changes coming from the modules.
Comment #193
mpdonadioOK, #192 should be take care of.
Reverted the stable template to 8.4.x HEAD (note there are no clanges in the actual patch) and removed the .addClass() from the system template.
Adjusted CR and spot checked WAVE.
Comment #195
lauriiiLooks good for me. I tested this manually and everything works as expected; fieldset has aria-label correctly and the description has an id on the wrapper in all different types of date and date range fields.
Comment #196
xjmThanks everyone! Based on @lauriii's review, a quick skim from @Cottser, and all the earlier usability and accessibility review, I think we're good here. Committed to 8.4.x. I'm also backporting this to 8.3.x as a major accessibility bug.
Comment #197
xjmThanks everyone! Based on @lauriii's review, a quick skim from @Cottser, and all the earlier usability and accessibility review, I think we're good here. Committed to 8.4.x. I'm also backporting this to 8.3.x as a major accessibility bug.
Comment #198
xjmMinor technical difficulties; commit should be there soon I hope. :)
Comment #201
yoroy commentedAaah, cool. Glad to see this make it to 8.3 as well. Congrats @mpdonadio, all!