Updated as of #249.

Problem/Motivation

Invalid child elements within grouping elements like details and vertical tabs are invisible to the user when the grouping element is closed or not active, respectively.

Note: Due to #182 and #188, this issue should only contain changes to the base system and Claro. The Claro changes will probably transfer to Default Admin with minor modifications.

Steps to reproduce

  1. In settings.php, set $settings['extension_discovery_scan_tests'] = TRUE.
  2. Enable the core form_test module.
  3. Set both the default and admin theme to Claro.
  4. For "standard" details elements:
    1. Go to /form_test/details-contains-required-fields.
    2. Click the Submit button.
    3. Close one of the details elements.
  5. For "accordion" style details elements on the node edit form:
    1. Enter a value without a beginning slash in the URL alias field.
    2. Click the Save button.
      This should cause a validation error: "The alias path has to start with a slash".
    3. Close the URL alias details element.
    4. Open a details element that does not have an error, such as the Authoring information element.
  6. For vertical tabs:
    1. Widen your viewport to at least 650px.
    2. Go to /admin/config/people/accounts.
    3. Within one or more tabs for the Emails configuration at the bottom of the form, remove the value for the required Subject field.
    4. Click the Save button.
    5. Click a tab which does not have an error to activate it.
    6. Click a tab which does have an error to activate it.

For RTL, either:

  • manually change the dir attribute on the html tag to rtl in the browser inspector / devtools, or
  • enable the Locale module, add Hebrew as a language, and repeat the above steps on the Hebrew version of the pages.
    For testing on the main branch, translation files for 11.4.x versions can be downloaded and then manually imported.
    Translations aren't necessary just to see the RTL version of the icon placement.

Proposed resolution

To improve the user experience and accessibility we should indicate when there are errors 'inside' a grouping element.

Option 1

  1. Following the logic of the early UX review in #24, reuse the red side border width from the page-top error block.

Merge request for option 1: https://git.drupalcode.org/project/drupal/-/merge_requests/16294

Option 2 (REJECTED)

  1. Details and vertical tabs inactive error state: Let the icon be the non-color visual cue and use a thinner side border (same width as the blue side border for open accordion details and active vertical tabs).
  2. Vertical tabs active error state: Use a thicker red side border to differentiate from the standard error state.

Both options

  1. Add the error icon from the page-top error block to grouping elements.
  2. Position the icon close to the end of the element's visible label.
  3. Use red text color for the element's visible label.
  4. Details: Surround the entire details element with a 1px red border.
  5. Use the input error color for the red border / red text.
  6. Vertical tabs: Use the input border color for the border of the active tab to so that it's clear when a tab with errors is also active.
  7. Append visually-hidden " (child error)" to the element's visible label.
  8. Add the attribute data-child-error-count to the details element.
    Because vertical tabs are progressively-enhanced details elements, the attribute will exist on the corresponding details element but not on the vertical tabs menu item (the li element).
    Themes can get the value of the attribute from the details element from within the JavaScript theme function.
  9. The value of the attribute should be an integer corresponding to the number of invalid children.

  10. For the icon in forced-colors mode, use the mask-image property and canvasText background color.

Remaining tasks

  1. Adapt previous work to Claro.
  2. Create merge request.
  3. Usability review.
  4. Forced colors mode for icon (#234).
  5. Manually test the RTL cases (and add screenshots to the issue summary?).
  6. Code review.
  7. Update change record.

UX & Accessibility Questions

  1. For vertical tabs, is the difference in border width now sufficient? (answered in #238)
  2. Any suggestions for making the active error state more apparent (#212, point 3)? Is this problem a blocker? (answered in #238)
  3. What are remaining blockers for this to be acceptable in a beta state?
    IIUC, the 11.5.0-beta1 release date is pretty soon.
    Since this is blocking #2915899: [PP-1] Enable the Inline Form Errors module in the Standard profile and recipe and we want to get that into 11.5.0, I assume we need to make this beta-ready by the 11.5.0 beta deadline.
    (answered in #238)

Option 2 screencast

2848507-option-2.480p.mov

User interface changes

  • Visually, the grouping elements will indicate that there are errors inside.
  • There will be a visually-hidden "(contains error)" appended to the summary or vertical tabs title for screen reader users.

Screenshots

Full color mode

For comparison, see the previous proposed solution screenshots for Seven.

Claro top error block:

This is unchanged. It's only provided here for reference.

LTR (left-to-right)

Scenario 1 : Standard details (/form_test/details-contains-required-fields)

Scenario 2 : Accordion style details (node edit form)

Scenario 3 : Vertical tabs (/admin/config/people/accounts)

Active item contains a child error:

Tab containing child errors is active.

Active item does not contain a child error:

Tab without child errors is active.

RTL (right-to-left)

Scenario 1 : Standard details (/he/form_test/details-contains-required-fields)

Submit closes a details with errors. Error indicator visible on closed details.

screenshot submit closes a details with errors

Scenario 2 : Accordion style details (node edit form)

URL alias without leading slash, Save, close "URL alias" details. Error indicator visible, no false positives on sibling details.

sceenshot url alias without leading slash

Scenario 3 : Vertical tabs (/he/admin/config/people/accounts)

Tested inactive error tab

screenshot inactive error tab

and active error tab

screenshot active error tab

Forced-colors mode
LTR (left-to-right)

Scenario 1 : Standard details (/form_test/details-contains-required-fields)

Scenario 2 : Accordion style details (node edit form)

Scenario 3 : Vertical tabs (/admin/config/people/accounts)

RTL (right-to-left)

Icon renders correctly on details

screenshot forced-colors mode renderring icon on details

and vertical tabs

screenshot vertical tab forced-colors renderring icon

CSS disabled

Demonstrates the hidden "(child error)" text.

Claro details, LTR, closed:

Introduced terminology

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#246 2848507-246-vertical-tabs-without-css-in-inspector.png316.69 KBkentr
#245 Capture d’écran 2026-08-20 à 10.36.21.png68.51 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.32.17.png46.22 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.36.03.png69.24 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.32.12.png34.53 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.34.35.png444.22 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.26.44.png329.41 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.23.39.png455.67 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.19.20.png509.74 KBgwenweb
#245 Capture d’écran 2026-08-20 à 10.13.20.png344.73 KBgwenweb
#245 Capture d’écran 2026-08-20 à 09.55.44.png290.38 KBgwenweb
#237 2848507-237-standard-details-forced-colors.png59.66 KBkentr
#237 2848507-237-accordion-details-forced-colors.png61.17 KBkentr
#237 2848507-237-vertical-tabs-forced-colors.png134.18 KBkentr
#233 2848507-233-claro-vertical-tabs-option-1-darker-border-non-error.png105.53 KBkentr
#230 2848507-230-claro-vertical-tabs-option-1-darker-border.png154.53 KBkentr
#229 2848507-option-2.480p.mov1.83 MBkentr
#219 2848507-219-claro-vertical-tabs-with-summary-ltr.png44.54 KBkentr
#219 2848507-219-claro-standard-details-ltr.png80.69 KBkentr
#219 2848507-219-claro-accordion-details-ltr.png78.28 KBkentr
#219 2848507-219-claro-vertical-tabs-ltr.png63.97 KBkentr
#213 2848507-213-standard-details.png73.62 KBkentr
#213 2848507-213-accordion-details.png87.46 KBkentr
#213 2848507-213-vertical-tabs.png60.64 KBkentr
#212 vertical_tabs.jpg47.05 KBrkoller
#208 claro-details-standard-rtl-closed.png23.86 KBkentr
#208 claro-details-standard-rtl-open.png47.96 KBkentr
#208 claro-details-standard-ltr-closed.png24.26 KBkentr
#208 claro-details-standard-ltr-open.png48.16 KBkentr
#208 claro-details-accordion-style-rtl-closed.png59.42 KBkentr
#208 claro-details-accordion-style-rtl-open.png54.96 KBkentr
#208 claro-details-accordion-style-ltr-closed.png58.64 KBkentr
#208 claro-details-accordion-style-ltr-open.png54.08 KBkentr
#207 claro-url-alias-field-ltr-closed-no-css.png12.36 KBkentr
#203 claro-vertical-tabs-with-summary-ltr-closed.png27.8 KBkentr
#203 claro-vertical-tabs-with-summary-ltr-open.png28.28 KBkentr
#203 claro-vertical-tabs-rtl-closed.png37.94 KBkentr
#203 claro-vertical-tabs-rtl-open.png39.18 KBkentr
#203 claro-vertical-tabs-ltr-closed.png37.51 KBkentr
#203 claro-vertical-tabs-ltr-open.png39.97 KBkentr
#203 claro-url-alias-field-rtl-closed.png18.13 KBkentr
#203 claro-url-alias-field-ltr-open.png52.36 KBkentr
#203 claro-top-error-block.png25.51 KBkentr
#202 claro-url-alias-field-ltr-closed.png17.32 KBkentr
#190 2848507-190-default-admin-error-block.png20.7 KBkentr
#190 2848507-190-claro-error-block.png21.64 KBkentr
#186 2848507-186-claro-vertical-tabs-not-active.png35.95 KBkentr
#177 2848507-nr-bot.txt145 bytesneeds-review-queue-bot
#175 2848507-175.patch14.97 KB_utsavsharma
#175 interdiff_172-175.txt2.04 KB_utsavsharma
#172 2848507-172.patch14.98 KByepa
#166 2848507-166.patch15.1 KBaleix
#163 interdiff_161-163.txt577 bytesnikitagupta
#163 2848507-163.patch20.62 KBnikitagupta
#161 reroll_diff_2848507_159-161.txt441 bytesankithashetty
#161 2848507-161.patch20.81 KBankithashetty
#159 interdiff_158-159.txt1.54 KBdjsagar
#159 2848507-159.patch20.86 KBdjsagar
#158 2848507-158-grouping_element_child_errors.patch20.8 KBolivier.br
#156 2848507-156-grouping_element_child_errors.patch20.71 KBdmsmidt
#156 bartik_details_closed_children_errors_ltr_ie11.png96.27 KBdmsmidt
#156 seven_details_closed_children_errors_ltr_ie11.png87.37 KBdmsmidt
#137 2848507-137-grouping_element_child_errors.patch20.7 KBdmsmidt
#134 2848507-134-grouping_element_child_errors.patch20.71 KBdmsmidt
#134 interdiff-2848507-128-134.txt14.31 KBdmsmidt
#132 seven_details_closed_children_errors_ltr.png28.98 KBdmsmidt
#132 seven_details_closed_children_errors_rtr.png29.32 KBdmsmidt
#132 seven_details_open_children_errors_rtr.png36.42 KBdmsmidt
#132 seven_vert_tabs_open_children_errors_ltr.png82.69 KBdmsmidt
#132 seven_vert_tabs_closed_children_errors_ltr.png87.49 KBdmsmidt
#132 seven_vert_tabs_open_children_errors_rtl.png74.19 KBdmsmidt
#132 seven_vert_tabs_closed_children_errors_rtl.png86.89 KBdmsmidt
#132 seven_details_open_children_errors_ltr.png38.73 KBdmsmidt
#132 seven_details_closed_normal_ltr.png14.02 KBdmsmidt
#132 bartik_vert_tabs_closed_children_errors_ltr.png48.22 KBdmsmidt
#132 bartik_vert_tabs_closed_children_errors_rtl.png27.73 KBdmsmidt
#132 bartik_details_closed_normal_ltr.png13.89 KBdmsmidt
#132 bartik_details_closed_normal_rtl.png14.19 KBdmsmidt
#128 2848507-128-grouping-element-child-errors.patch17.29 KBandrewmacpherson
#128 interdiff-2848507-126-128.txt783 bytesandrewmacpherson
#126 2848507-126-grouping-element-child-errors.patch17.1 KBandrewmacpherson
#126 interdiff-2848507-124-126.txt1.17 KBandrewmacpherson
#124 2848507-124-grouping-element-child-errors.patch17.62 KBandrewmacpherson
#124 interdiff-2848507-119-124.txt5.36 KBandrewmacpherson
#120 2848507-119-grouping-element-child-errors.patch17.84 KBandrewmacpherson
#111 2848507-111-85x.patch17.85 KBdmsmidt
#111 interdiff-2848507-105-111-85x.txt749 bytesdmsmidt
#111 2848507-111-84x.patch17.84 KBdmsmidt
#111 interdiff-2848507-105-111-84x.txt749 bytesdmsmidt
#9 2848507-9-grouping_element_children_errors.patch1.35 KBdmsmidt
#13 00000003.png43.83 KBttamniwdoog
#13 00000004.png153.89 KBttamniwdoog
#13 00000006.png449.13 KBttamniwdoog
#17 drupal-n2848507-17-without.png21.44 KBdamienmckenna
#17 drupal-n2848507-17-with.png21.86 KBdamienmckenna
#17 drupal-n2848507-17.patch2.15 KBdamienmckenna
#17 drupal-n2848507-17.interdiff.txt1.44 KBdamienmckenna
#19 drupal-n2848507-17-collapsed.png7.95 KBdamienmckenna
#24 error_message_drupal_styling.png1.97 KBdmsmidt
#25 details-error-mark.png45.98 KByoroy
#32 vert_tabs_child_errors_non_focus_rtl_seven.png47.91 KBdmsmidt
#32 vert_tabs_child_errors_non_focus_ltr_seven.png47.06 KBdmsmidt
#32 vert_tabs_child_errors_focus_ltr_seven.png51.02 KBdmsmidt
#32 meta_details_child_errors_closed_rtl_seven.png11.52 KBdmsmidt
#32 meta_details_child_errors_open_rtl_seven.png29.4 KBdmsmidt
#32 meta_details_child_errors_closed_ltr_seven.png7.59 KBdmsmidt
#32 details_child_errors_closed_ltr_seven.png2.86 KBdmsmidt
#32 vert_tabs_child_errors_non_focus_ltr_bartik.png12.18 KBdmsmidt
#32 details_child_errors_closed_ltr_bartik.png2.83 KBdmsmidt
#32 2848507-32-grouping_element_child_errors.patch5.75 KBdmsmidt
#32 interdiff-2848507-17-32.txt4.55 KBdmsmidt
#34 interdiff-2848507-32-34.txt1.18 KBdmsmidt
#34 2848507-34-grouping_element_child_errors.patch7.17 KBdmsmidt
#38 2848507-38-grouping_element_child_errors.patch7.35 KBpk188
#43 2848507-43-grouping_element_child_errors.patch8.17 KBpk188
#47 jira-error.png11.84 KByoroy
#48 2848507-48-grouping_element_child_errors.patch8.76 KBBarisW
#48 interdiff-43-48.txt1004 bytesBarisW
#50 details_bartik_child_errors_before.png21.45 KBdmsmidt
#50 details_bartik_child_errors.png20.82 KBdmsmidt
#54 2848507-54-grouping_element_child_errors.patch11 KBdmsmidt
#54 interdiff-2848507-48-54.txt13.21 KBdmsmidt
#56 2848507-56-grouping_element_child_errors.patch11.04 KBandrewmacpherson
#61 interdiff-2848507-56-61.txt3.73 KBdmsmidt
#61 2848507-61.patch12.3 KBdmsmidt
#62 interdiff-2848507-61-62.txt8.84 KBdmsmidt
#62 2848507-62-grouping_element_child_errors.patch17.03 KBdmsmidt
#64 interdiff-2848507-62-64.txt1.07 KBdmsmidt
#64 2848507-64-grouping_element_child_errors.patch17.03 KBdmsmidt
#66 2848507-64-grouping_element_child_errors.PATCH_ONLY.patch5.51 KBdmsmidt
#73 2848507-73-grouping_element_child_errors.patch17.11 KBandrewmacpherson
#73 interdiff-2848507-64-73.txt1.41 KBandrewmacpherson
#74 2848507-74.png130.61 KBandrewmacpherson
#79 interdiff-2848507-73-79.txt2 KBdmsmidt
#79 2848507-79-grouping_element_child_errors.patch16.92 KBdmsmidt
#81 interdiff-2848507-79-81.txt2.35 KBdmsmidt
#81 2848507-81-grouping_element_child_errors.patch16.92 KBdmsmidt
#87 interdiff-2848507-81-87.txt2.51 KBandrewmacpherson
#87 2848507-87-grouping_element_child_errors.patch17.76 KBandrewmacpherson
#95 interdiff-2848507-87-95.txt1.93 KBjefuri
#95 2848507-95-grouping_element_child_errors.patch17.76 KBjefuri
#101 interdiff-2848507-87-101.txt1.93 KBandrewmacpherson
#101 2848507-101-grouping_element_child_errors.patch17.76 KBandrewmacpherson
#102 2848507-102-84x.patch17.76 KBmpdonadio
#102 2848507-102-85x.patch17.76 KBmpdonadio
#105 2848507-105-84x.patch17.78 KBdmsmidt
#105 interdiff-2848507-102-105-84x.txt570 bytesdmsmidt
#105 2848507-105-85x.patch17.78 KBdmsmidt
#105 interdiff-2848507-102-105-85x.txt570 bytesdmsmidt

Issue fork drupal-2848507

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

dmsmidt created an issue. See original summary.

dmsmidt’s picture

We just talked about this in the UX hangout discussion (http://youtu.be/X2LJEiW2BS0).
At least we can color the borders red and make them a bit thicker.

Since #2754977: Enhance formErrorHandler to include children errors on RenderElements is in we now have enough information on the grouping elements to know if there are errors on child elements.

andrewmacpherson’s picture

Issue tags: -a11y

Tag clean up: "accessibility" is the preferred one. The "a11y" tag doesn't have many issues so I'm moving them all to "accessibility".

andrewmacpherson’s picture

For vertical tabs we could iappend an error indication in the tab summary message.

e.g. if there is one error, say "Error: [field label]", or if there are several errors, something like "Contains multiple errors."

It doesn't help us with the details group though.

dmsmidt’s picture

@adrewmacpherson, do we really need to add text?
What about adding the IFE error icon before the labels and adding a thick red border?

dmsmidt’s picture

Assigned: Unassigned » dmsmidt

Working on the PHP part.

dmsmidt’s picture

Assigned: dmsmidt » Unassigned
Status: Active » Needs review
Issue tags: +Needs tests

Here is a first stab at things. This will add the 'error' class to tabs with errors.
And the 'error' class plus 'aria-invalid' to details and fieldsets.
Stylers go ahead!

We will need a functional JS test for this.

dmsmidt’s picture

Also, added vertical tabs to the module for easy testing:
https://github.com/dmsmidt/errorstyle

dmsmidt’s picture

Status: Needs review » Needs work

The last submitted patch, 9: 2848507-9-grouping_element_children_errors.patch, failed testing.

andrewmacpherson’s picture

@dmsmidt Re: comment #5

Yes, an error icon (with fallback text) will do the job, better than my text suggestion.

I was trying to address "At least we can color the borders red and make them a bit thicker" from comment #2. A thick red border alone would not be sufficient to convey an error because:

  • Red is not sufficient because (1) users with colour-vision impairments can have difficulty perceiving it, and (2) it may not work effectively in other colour spaces (e.g. Windows' high contrast mode). In other words, can a user distinguish between a tab with a red border, and a tab with a dark-grey border?
  • A thick border has no meaning, and can convey anything. It's sometimes used to convey :focus, for instance.

Including the error icon in vertical tabs addresses these, because it uses shape as well as colour, and is a meaningful indication of "error".

andrewmacpherson’s picture

Review of the patch in #9:

  1. In vertical tabs, the class="error" and aria-invalid="true" attributes are applied to the the <details> element nested inside the tab panel (via PHP) and the error class is applied to the vertical tab itself via JS. I changed the names of these classes to confirm it worked.
  2. Adding an error class will not be sufficient on it's own. Presumably the idea is that this class would be used to add an error icon (a red cross, say). If it's just an icon, it will need a text fallback. Ideally this would be an inline image element, but we don't seem to use many of those in core anymore. A CSS background images and/or generated content will not be presented to screen readers, so we should either use an inline image element with an alt attribute, or include a span.visually-hidden the vertical tab somehow, such as a translatable string in vertical-tabs.js. (I would put it after the tab title, but before any vertical tab summary text. This might mean prepending it to the tab summary string.)
  3. I don't think it is an appropriate use of aria-invalid to put it on the container element. The WAI-ARIA recs (1.0 or 1.1CR) are a bit vague on this, saying it can be used on "all elements of the base markup". As far as I am aware though, it is only supported when it is applied to a form input element, not a div/details wrapper. In a quick test with Chromevox and the errorstyle module, it was not announced.
ttamniwdoog’s picture

StatusFileSize
new43.83 KB
new153.89 KB
new449.13 KB

Steps to recreate:
1) In Drupal 8.4, create a new article content type here: /node/add/article
2) Scroll down to the URL Path Settings in the vertical tabs: /node/add/article#edit-path-settings
3) Enter in a node title and then enter in a bogus URL that doesn't start with a forward slash("/") as seen here: https://www.drupal.org/files/issues/00000003.png
4) Click "Save and Publish"
5) After saving the page, you should see an error at the top of the page like: https://www.drupal.org/files/issues/00000004.png
6) Also notice the error seen in the URL Path Settings now. Should look like this: https://www.drupal.org/files/issues/00000006.png

markie’s picture

As part of an internal accessibility sprint we determined these next steps:

  1. Identify attributes to be added to which element (summary / details)
    1. Reuse error class on both.
  2. Add class programmatically
    (Drupal\Core\Render\Element\RenderElement::preRenderGroup).
    (/core/misc/vertical-tabs.js (line 68ish)
  3. Submit patch for HTML changes.
  4. Update CSS to properly show changes.
  5. Submit patch for CSS changes.
  6. Identify correct ARIA attribute(s) to add.
    1. Add “aria-invalid = true”?
    2. Do any other CMSes try to solve this issue?
    3. Are there any articles that discuss this issue?
    4. No ARIA is better than bad ARIA
  7. Update tests to confirm changes.
  8. Submit patch with test changes.
  9. (repeat steps 6 and 7 as needed)
andrewmacpherson’s picture

Re: #14 - I think we've covered all of that in the various comments so far.

Identify attributes to be added to which element (summary / details)

Reuse error class on both.

Do you mean adding a .error class to the details and the summary elements? Surely we can style the summary with a selector like details.error summary.

aria-invalid=true doesn't work for anything other than form inputs, so putting it on a <details> is of no benefit.

dmsmidt’s picture

I think it is pretty clear where we stand.

As per #12-2 we now need to "visually" show that there is a child error, some solution are proposed.

@andres (#12-3), I did some research about aria-invalid before I made the patch, but indeed those specs are very vague. I read them as: 'it is ok to add them to elements other than things like , but we may not do anything with it". I'm ok with removing them.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new21.44 KB
new21.86 KB
new2.15 KB
new1.44 KB

Here's what a motley crew at Mediacurrent came up with (cehfisher, DamienMcKenna, dbungard, markie, Michelle, samuel.seide, smurrayatwork, ttamniwdoog, Widescreen_bob). This adds a border to the fieldset ("details" tag) in both expanded and collapsed formats, and then adds the error check mark to the summary text.

This is what the error message looks like without the changes:

Without any changes.

This is what the error message looks like with the changes:

With the patch applied.

While reviewing this it was noticed that the field with the error class is not AAA compliant (red text with a reddish background color), maybe something to look at later?

dmsmidt’s picture

First actual visual changes, great!

Indeed, the field error styling should have it's own issue.

Could you also provide a screenshot of how this looks on closed details? The most pressing concern is that it is not clear where errors are if a details is closed or a vertical tab not focussed.

How would the proposal translate to vertical tabs, could you guys come up with something similar?

One thing I thought when looking at the icon in the top right: 'this looks like a red close button'. Although it is perfectly aligned, the location may not be the best. Any thought?

damienmckenna’s picture

StatusFileSize
new7.95 KB

This is what the fieldset looks like when it's collapsed:

With the patch, when the fieldset is collapsed.

damienmckenna’s picture

We did not get into vertical tabs in the main content area, we just focused on the sidebar fieldset on node forms.

dmsmidt’s picture

Great start. Thanks for the additional screenshot.

In closed form the red icon works better. Maybe we can remove it when the element is open. In combination with IFE the icon would already be present beneath the field.
Maybe a screenshot with IFE enabled and the element open would also help.

One, not belittling ment note: in D8 fieldsets can't be collapsed anymore, they are sort of replaced by details elements. Let's keep the terminology clear to avoid confusion.

Status: Needs review » Needs work

The last submitted patch, 17: drupal-n2848507-17.patch, failed testing.

dmsmidt’s picture

Issue summary: View changes
dmsmidt’s picture

StatusFileSize
new1.97 KB

Design feedback / idea from the UX meeting of 15 march (see demo at: https://www.youtube.com/watch?v=lWKo_OK6gHg):

"Reuse the error message styling (thick left border)."
"In open state and IFE enabled the element becomes crowded."

yoroy’s picture

Issue tags: -UX, -user experience +Usability
StatusFileSize
new45.98 KB

An incomplete proposal:

- How it could look with the red left border (using the wrong color red here)
- Can we do something with a ::before pseudo CSS class to add actual error wording to the container?

andrewmacpherson’s picture

Re: #25

The thick red border looks smart! I expect it will work just as well inside a vertical tab header.

Using a thick border alone (comment settings in the screenshot) isn't enough IMO. The fact that it's thicker than the regular border technically means it doesn't rely on colour alone. However the thickness doesn't convey "error" - the red colour provides that. Including the error icon would be better because it's a meaningful symbol.

So far the screenshots have used the special details styling from Seven's node form. We'll need to make it work with Seven's general details style, and Bartik.

- Can we do something with a ::before pseudo CSS class to add actual error wording to the container?

No, CSS-generated text presents a few problems:

  • Currently, not all browsers pass the CSS content to host accessibility APIs. Accessible Name and Description: Computation and API Mappings 1.1 will eventually require user agents to take CSS content into account - it's still at the working draft stage. Some browsers already support it, but notably IE11 does not. I don't expect this will ever be fixed in IE, so until we drop support for IE11 we should avoid including text via CSS.
    EDIT: I tried a CSS generated content test case with Chrome 57 + ChromeVox. This combination doesn't read the CSS generated content either.
  • The wording needs to be translatable. So far we've only used CSS content: for a few punctuation symbols, not translatable strings. It's possible to use HTML attributes to provide CSS content (e.g. content: attr(data-foo); but I don't see how that's better than just putting it in a HTML element.

The patch in #17 adds the error class to vertical tabs via JS. We can provide a translatable string at the same time. For details elements, providing error wording in HTML would be preferable I think.

andrewmacpherson’s picture

Patch from #17:

+.entity-meta details.error,
+.entity-meta details[open].error {

The entity-meta sidebar markup comes from Seven. These selectors belong in core/themes/seven/css/components/entity-meta.css.

andrewmacpherson’s picture

Re: #17

While reviewing this it was noticed that the field with the error class is not AAA compliant (red text with a reddish background color), maybe something to look at later?

It has a contrast ratio of 7.02:1 which does indeed pass at level-AAA. In any case our target for the core a11y gate is 4.5:1 to meet level-AA.

I just reviewed the information at Specifying colors and contrast for accessibility - it's a bit misleading because it says we need to meet level-AA, but then mentions the enhanced contrast ratios needed for level-AAA. I should update that page to make it clearer which numbers are for level-AA. Although obviously I'd prefer we met AAA, which we do :-)

dmsmidt’s picture

Issue tags: +DevDaysSeville
yoroy’s picture

Forgot to say thank you to @andrewmacpherson for explaining why and how. Thank you @andrewmacpherson :)

dmsmidt’s picture

Assigned: Unassigned » dmsmidt

Working on this @Seville.

dmsmidt’s picture

  • Added error styling for vertical tabs.
  • Added the thick border to the left (with a bit of a rounded corner), corresponding to the error message styling.
  • Styling done per component (separate css files).
  • Position the icon correctly on multi-line titles/summaries.
  • Added the error styling also to Stable to have it show in Bartik. Since this is a bugfix and the styling is on a new class I think we can add this styling to Stable.
  • Also made the details element (with child error) background for Bartik white to have enough contrast.
  • The error styling is disabled when a fieldset is focused or a details element is open, this prevents that the UI becomes too crowded. When the children are shown, we don't need to mark the grouping element anymore.
  • Added RTL styling.

Some after screenshots added to the descriptions according to these changes.

@todo
- Novice: add before screenshots of all after scenarios
- Fix test fail
- Provide error wording for a11y
- Tests (check for the error class and error wording)

Status: Needs review » Needs work

The last submitted patch, 32: 2848507-32-grouping_element_child_errors.patch, failed testing.

dmsmidt’s picture

Status: Needs work » Needs review
StatusFileSize
new1.18 KB
new7.17 KB

This adds some missing CSS and fixes the test failure.
We now cover the addition of the error class for details elements in our tests.
Concerning the tests, we now only need a Functional JS test for the error class on Vertical Tabs.

lauriii’s picture

Status: Needs review » Needs work

We should not make any changes to Classy or Stable on this issue because they are frozen. We only want to change them on bug fixes that are non-disruptive and major enough. The first assumption should always be that we cannot change them. However, what we can do is create minimalistic styles for core and a bit nicer styles for Bartik and Seven. Then in Drupal 9 those styles will be available in Stable.

+++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php
@@ -204,6 +204,11 @@ public static function preRenderGroup($element) {
+      $element['#attributes']['class'][] = 'error';

We should use data attribute instead of classes when the selector is used by JavaScript

andrewmacpherson’s picture

Re: #35 - I think this error class will be relevant without JS. Currently we use a polyfill-type of approach for the details/summary elements, but native support is now in Blink and Firefox. Details/summary groups work in these browsers when JS is disabled - this class is used for styling in the patch, combined with the native HTML5 'open' attribute...

+details.error:not([open]) {
wolffereast’s picture

pk188’s picture

Status: Needs work » Needs review
StatusFileSize
new7.35 KB

Re-rolled and fixed #35

Status: Needs review » Needs work

The last submitted patch, 38: 2848507-38-grouping_element_child_errors.patch, failed testing.

andrewmacpherson’s picture

This needs a re-roll to account for Drupal core now using ES6 for javascript development. That change record describes the new contributor workflow for ES6 javascript. See the sections on "creating (or reviewing) core patches".

The patch in #38 changes core/misc/vertical-tabs.js, but the new ES6 file core/misc/vertical-tabs.es6.js needs to be updated too.

andrewmacpherson’s picture

Issue tags: +Needs reroll
andrewmacpherson’s picture

Issue tags: +sprint
pk188’s picture

Re rolled.
Fixed #40.

pk188’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Status: Needs review » Needs work

The last submitted patch, 43: 2848507-43-grouping_element_child_errors.patch, failed testing. View results

BarisW’s picture

Assigned: Unassigned » BarisW

I'll work on this patch as part of the Haarlem accessibility sprint.

yoroy’s picture

StatusFileSize
new11.84 KB

Jira puts the icon inside the thick left border, maybe we can do same?

BarisW’s picture

Assigned: BarisW » Unassigned
Status: Needs work » Needs review
StatusFileSize
new8.76 KB
new1004 bytes

Fixed the error introduced in #43. I would suggest adding these changes to classy, I think this is the most minimal version that needs to be added to Classy.

andrewmacpherson’s picture

@yoroy - that Jira style is interesting. If we put the icon inside a thick border for this issue, would we want to change our message boxes to match?

dmsmidt’s picture

Status: Needs review » Needs work
StatusFileSize
new21.45 KB
new20.82 KB

@andrewmacpherson and @yoroy, thanks for the nice styling idea. I think it could be implemented in a new theme. The styling introduced by this patch are in line with current styling patterns of errors and proposed during an UX meeting (see #24). Redesigning (error) messages is out of scope for this issue.

@lauriii these styling addition (no changes) are actually major accessibility bug fixes. And as mentioned in #36 the class is used for styling. Could you reconsider?

Bartik details element styling is off, see:
Before

After

yoroy’s picture

I was trying to address #26, the part where a thick border only was not considered enough. But the current error icon is already added here as well so that's ok then. Agreed that a new design is out of scope here.

lauriii’s picture

  1. +++ b/core/misc/vertical-tabs.es6.js
    @@ -60,7 +60,8 @@
    +            children_errors: $that.hasClass('error')
    
    +++ b/core/lib/Drupal/Core/Render/Element/RenderElement.php
    @@ -197,13 +197,18 @@ public static function preRenderGroup($element) {
    +      $element['#attributes']['class'][] = 'error';
    

    Could we add a JS specific indicator for the errors? Also, .error isn't the most self-documenting name for this.

    Also according to Classy's BC policy, this change isn't allowed. However, I think if we can make this more specific we could make this change since it wouldn't cause too much of risk anymore and would still be a great improvement.

  2. +++ b/core/misc/vertical-tabs.es6.js
    @@ -246,6 +247,11 @@
    +      tab.item.addClass('error');
    

    Could we use the BEM modifier pattern for naming the class for the visual styles?

  3. +++ b/core/themes/classy/css/components/details.css
    @@ -21,3 +21,30 @@ summary {
    +details.error:not([open]) summary:before {
    

    Changes to Classy aren't technically allowed. We should move these changes to Seven.

  4. +++ b/core/themes/seven/css/components/entity-meta.css
    @@ -57,3 +57,21 @@
    +.entity-meta details.error:not([open]) {
    

    If we can come up with a more specific class name, we could probably make the CSS less specific.

dmsmidt’s picture

Assigned: Unassigned » dmsmidt
dmsmidt’s picture

Assigned: dmsmidt » Unassigned
Status: Needs work » Needs review
Issue tags: -Novice
StatusFileSize
new11 KB
new13.21 KB

I addressed all @laurii's concerns in this patch, only styling for Bartik and Seven are changed. I also fixed #50 (Bartik details styling regression).

I'll create a follow up issue to make this even more accessible by announcing the amount of child errors if a closed detail/tab gets focus.
This is however a bit out of scope, but the groundwork is now also present (data-child-errors-count).

Should we mark this Major priority btw? Since it is a blocker for Inline Form Errors and a serious non-contained accessibility bug.

Edit: created follow up and working on a fix #2892443: Announce that grouping elements have child element errors for accessibility.

Status: Needs review » Needs work

The last submitted patch, 54: 2848507-54-grouping_element_child_errors.patch, failed testing. View results

andrewmacpherson’s picture

Status: Needs work » Needs review
StatusFileSize
new11.04 KB

This needed a re-roll following #2880007: Auto-fix ESLint errors and warnings. There was trouble with some offsets, and the first chunk in vertical-tabs.es6.js already had a trailing comma after the ESLint changes in that issue.

-            details: $that
+            details: $that,
+            children_errors: $that.data('children-errors-count')

Sorry, no interdiff file. I got errors when trying to make one, relating to the same chunk. I manually compared patches #54 and #56 prior to uploading it here.

andrewmacpherson’s picture

The simplest way to announce that grouping elements have child errors in a screen reader, is for the error icon to have alternative text (see comment #11).

However, the icon is a CSS background image, on a pseudo-element, so we can't associate the text-alternative directly with the icon :-(

The workaround for this is to provide the text alternative in a span.visually-hidden, nested inside the focusable control, so it forms part of the computed accessible name.

e.g.

<details open data-drupal-selector="edit-nested-details-closed" id="edit-nested-details-closed" class="js-form-wrapper form-wrapper form-wrapper--child-error details--child-error" data-children-errors-count="1">
  <summary role="button" aria-controls="edit-nested-details-closed" aria-expanded="false" aria-pressed="false">
    :: before
    Nested details closed
    <span class="visually-hidden child-error-indicator">(contains error)</span>
  </summary>

  ...

</details>

The interesting part is that the icon disappears when the grouping element becomes open. Do we make the text fallback disappear too? I can imagine a confusing scenario like this...

  • A user finds a grouping element and hear "contains errors"
  • They open the grouping element, then go off browsing the rest off the page, e.g. by navigating headings
  • Try to come back to the error, and not be able to find the grouping element that "contains errors".

So let's leave the text-alternative in place (visually-hidden) all the time.

I'd rather deal with the text-alternative in this issue, instead of a follow-up. I might take a crack at it tomorrow.

dmsmidt’s picture

Status: Needs review » Needs work

Some valid points by @andrew, so putting this back to needs work.

dmsmidt’s picture

Assigned: Unassigned » dmsmidt
dmsmidt’s picture

Assigned: dmsmidt » Unassigned
Status: Needs work » Needs review

Here is an implementation of what @andrew suggested.
Could you test it?

If it works we should add a functional JS test for the vertical tabs en elaborate on the existing browsertest a bit.

dmsmidt’s picture

StatusFileSize
new3.73 KB
new12.3 KB
dmsmidt’s picture

Issue tags: -Needs tests +Needs JavaScript review
StatusFileSize
new8.84 KB
new17.03 KB

Woop, first Functional JS test for a core Render element (hooray for a11y tests) :-).
We now have full test coverage for details and vertical tabs concerning the changes of this issue.
I also did some further cleaned of the patch.

For the JS reviewers, note that we now need to use html() instead of text() to support the hidden error indicator span.

Status: Needs review » Needs work

The last submitted patch, 62: 2848507-62-grouping_element_child_errors.patch, failed testing. View results

dmsmidt’s picture

Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new17.03 KB

Test fix.

GrandmaGlassesRopeMan’s picture

@dmsmidt

Can you upload a test only patch for #64?

dmsmidt’s picture

Priority: Normal » Major
StatusFileSize
new5.51 KB

Sure, here it is.

Also bumping the priority, cause it is a IFE blocker and also without IFE an accessibility problem.

Status: Needs review » Needs work
dmsmidt’s picture

Status: Needs work » Needs review

Fails as expected.

GrandmaGlassesRopeMan’s picture

  1. +++ b/core/misc/vertical-tabs.es6.js
    @@ -56,8 +56,9 @@
    +            title: $that.find('> summary').html(),
    

    The expected behavior here is that the html contents is returned instead of a glob of all the text nodes?

  2. +++ b/core/misc/vertical-tabs.es6.js
    @@ -56,8 +56,9 @@
    +            child_error_count: $that.data('child-error-count'),
    

    This isn't critical, but it is something to think about. The way jQuery is storing data attributes is changing in 3.0, http://jquery.com/upgrade-guide/3.0/#breaking-change-data-names-containing-dashes.

dmsmidt’s picture

@drpal

#69.1: yes it is, see #62, last sentence.
#69.2: alright, I'll keep that in mind. I guess there will be a major cleanup when the time comes for Drupal.

yoroy’s picture

andrewmacpherson’s picture

Manual testing of patch #64. I used the dmsmidt/errorstyle test module, and node/article/add.

I like it very much :-) I'm happy to sign off on this approach for the icon's text alternative.

A couple of points about the message text in formatPlural():

  1. + '@title <span class="visually-hidden child-error-indicator">(contains an error)</span>',
    Let's shorten this to "contains error". Most native screen reader announcements are quite terse (in English at least) and little words like "an" sound out of place.
  2. + '@title <span class="visually-hidden child-error-indicator">(contains @count errors)</span>
    Mixed feelings about this. When a group is closed the error icon doesn't convey the number of child errors, so we're giving a screen reader user information that we're not providing to sighted users. However when a group is open, it's very easy for a sighted user to see that it "contains 3 errors". Overall, I think we can leave this as it is - it will very likely help a user orient themselves when reviewing vertical tab titles.
andrewmacpherson’s picture

This patch addresses #72.1 - a minor string change.

andrewmacpherson’s picture

StatusFileSize
new130.61 KB

Alas, I found a bug.

If the node authoring information has an error, the text alternative says "contains 3 errors". You can experience this by submitting a node with the authoring date component filled in, and the time component left empty. Of course, there is only one error message, and visually only two components are marked as an error (i.e. the date and time parts). So "contains 3 errors" could be confusing for a screen reader user.

node form with error in authoring information datetime element

I think this is probably an edge case for datatime elements. Since it only affects one element type (and only causes a problem if it is inside a details container) can we treat this as a follow-up issue? Possibly some other compound elements might be affected.

Alternatively, if we change the plural message to "contains several errors", we can mitigate this problem, at least as far as the UI indication goes. (The data-child-error-count="3" attribute would still be wrong, but a user wouldn't experience this directly.)

skaught’s picture

Status: Needs review » Reviewed & tested by the community

i have just been locally playing with dmsmidt/errorstyle to add in time to the Datetime field.. and stumbled upon #2875131: Datetime element formats are confusing while trying to find time formatting options.. suffice it to say, the datetime element is confusing, both as a form element (DX) and it's related validation notices (UX)

similarly, the Datelist element suffers from the same oddness when it comes to how which aspects of theses combo fields are in an error'd state.

IMO these are greater issue these two elements themselves, not of this issue 'Indicate that grouping elements in details and vertical tabs... other related issue for these elements and their error notification should be created.

mpdonadio’s picture

#74, #75, there are one more more interrelated issues regarding that (the format weirdness, the error message(s), no labels when on a non-HTML5 browser, maybe more). Some are listed in datetime.module and some are in forms system. I have a sort-term todo to triage all of these into a mini-plan to improve the overall UX of the datetime / datelist elements, the overall UX of the datetime / daterange / timestamp widgets, and unify the UX (as much as possible) for the datetime / daterange / timestamp widgets.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Looks a lot better for me! Thank you for making the changes. There are still a few issues that show up in the csslint output here.

dmsmidt’s picture

Assigned: Unassigned » dmsmidt
dmsmidt’s picture

Assigned: dmsmidt » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2 KB
new16.92 KB

Concerning #74, this is due to a different bug. Children errors are not computed correctly, this is not limited to date fields.
Follow-up: #2897601: Incorrect #children_errors count from bubbled errors in compound elements .

Fixed ccslint notices.

andrewmacpherson’s picture

Status: Needs review » Needs work

Chatted with @mgifford about #74 in the #accessibility slack channel.

We'd like to go with "contains several errors" to avoid the confusing count in the text alternative.

Maybe when #2897601: Incorrect #children_errors count from bubbled errors in compound elements is done we can re-introduce the numeric count.

EDIT: but since were basing the single/plural phrase on #children_errors, we'd still have the plural when ther is only one compiund element.

So, compromise to get this over the line. Let's just avoid using the plural format, and always say "contains error".

dmsmidt’s picture

Status: Needs work » Needs review
StatusFileSize
new2.35 KB
new16.92 KB

Alright, removed the plural version. This can always be re-added later when the follow up is fixed.
Fingers crossed, I wasn't able to test the rewrite because my system is just doing a dist upgrade.
Testbot will tell..

andrewmacpherson’s picture

Status: Needs review » Reviewed & tested by the community

Still working well.

#79 cleaned up 4 instances of the "float can't be used with display: inline-block" coding standards message.

Of the remaining coding standards messages, none of them are being introduced by lines this patch touches:

  • "Using width with border-right can sometimes make elements larger than you expect." - refers to .vertical-tabs__menu-item.is-selected. I think this is fine/intentional. It's the style of the currently selected vertical tab.
  • "Outlines shouldn't be hidden unless other visual changes are made." - refers to .vertical-tabs__menu-item a:focus This is definitely a false positive, vertical tabs does have an alternative visual change.
  • "Unqualified attribute selectors are known to be slow." - refers to [data-vertical-tabs-panes]. I don't understand this one - we have lots of other [dir="rtl"] attribute selectors which it doesn't complain about.

#81 changed the text alternative for the error indicator, to work around the bug I noticed in #74

xjm’s picture

Does this issue need a change record for the child-error-count it's introducing? (Sorry, don't know much about JS.)

It has fixes for Bartik and Seven but not Stable/Classy, which aligns with our BC policy.

andrewmacpherson’s picture

Yeah, I guess the new data-child-error-count attribute counts as small API addition affecting themers? The idea is that custom theme CSS could present a visible numeric badge with the error count, like an iOS app icon does.

We already discussed (#72, #74, #80) making use of the error count to convey "contains several errors" in the accessible text-alternative for the details error icon, but held back (in core themes) because of #2897601: Incorrect #children_errors count from bubbled errors in compound elements .

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Agreed with #83 that we should create a minor change record for the Drupal.theme.verticalTab API addition so developers who use this would be aware of the new key.

Besides that:

  1. +++ b/core/misc/vertical-tabs.js
    @@ -39,8 +39,9 @@
    +            child_error_count: $that.data('child-error-count')
    

    This should be camelcase

  2. +++ b/core/misc/vertical-tabs.js
    @@ -138,7 +139,12 @@
       Drupal.theme.verticalTab = function (settings) {
    

    Could we add the newly added key to the docblock?

andrewmacpherson’s picture

Assigned: Unassigned » andrewmacpherson

doing #85 now

andrewmacpherson’s picture

Assigned: andrewmacpherson » Unassigned
Status: Needs work » Needs review
StatusFileSize
new2.51 KB
new17.76 KB

New patch addresses #85, and it gave me a chance to learn the new es6 yarn watch workflow too.

Could we add the newly added key to the docblock?

I've updated the keys for Drupal.verticalTab and Drupal.theme.verticalTab which were out of sync. Now they both mention the same 3 settings keys.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dmsmidt’s picture

Version: 8.5.x-dev » 8.4.x-dev
Status: Needs review » Reviewed & tested by the community

Manual tested, still works. All points in #85 are fixed. Back to RTBC, thanks!

lauriii’s picture

Issue tags: +Needs change record

I forgot to add the tag on #85

dmsmidt’s picture

Issue tags: -Needs change record
yoroy’s picture

Just to confirm that the interaction and visual design are good to go here. There's ways we can make this look nicer, but what this patch does is in line with the currently available visual vocabulary of Seven theme. (See #50)

gambry’s picture

Really small comment issue fixable on commit:

+++ b/core/misc/vertical-tabs.es6.js
@@ -126,6 +127,8 @@
+   * @param {jQuery} settings.childErrorCount
+   *   The number of form errors contained inside the tab pane.

@@ -249,6 +252,10 @@
+   * @param {jQuery} settings.childErrorCount
+   *   The number of form errors contained inside the tab pane.

@param defines a jQuery object but comment suggests a number (and count($element['#children_errors']) confirms).

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks @gambry. I don't think a discrepancy on the data type of a parameter is something a committer should fix on commit, so setting NW for that. Let's make sure we don't have a wrong assumption in the code about the data type.

+++ b/core/misc/vertical-tabs.js
@@ -138,7 +139,12 @@
   };
 })(jQuery, Drupal, drupalSettings);
\ No newline at end of file

This file is also missing its closing newline. Sorry, disregard, that's the auto-generated ES5 file. Still getting used to that.

Sorry to bump this back over small things; I know it's been RTBC a long time without further review. (This is also why @gambry was probably reluctant to NW it.) Unfortunately most of the committers are not as fluent in JS and this makes patches with JS get delayed. I just want to let you know I'm definitely aware of how long this patch has been under review and that it's a major UX/a11y bug that affects IFE.

jefuri’s picture

@dmsmidt already gave me a heads up and begged me to finish this issue :P.

But seriously, the data type comments form the review are fixed and rerolled against 8.5.x.

Happy reviewing!

jefuri’s picture

Status: Needs work » Needs review
jefuri’s picture

Version: 8.4.x-dev » 8.5.x-dev
andrewmacpherson’s picture

Thanks for the patch @jefuri.

This is categorized as a major bug, so it's still eligible for 8.4.x. I've re-queued the test against that branch, and will review it when the tests have run.

andrewmacpherson’s picture

Version: 8.5.x-dev » 8.4.x-dev
andrewmacpherson’s picture

Status: Needs review » Needs work

Review of patch #95:

  1. The interdiff for vertical-tabs.es6.js and vertical-tabs.es6.js looks fine. It corrects the last outstanding JS documentation nitpick that @gambry found in #93. (Good, this part is what we needed to be back at RTBC).
  2. The patch in #95 applies cleanly to 8.5.x (Good)
  3. It no longer applies cleanly to the 8.4.x branch. The seven.libraries.yml file was re-arranged slightly in #2887860: Allow attributes to be passed to admin blocks (admin_block theme hook). The colors.css line was moved. This should be easy to fix.

So what happens next? Do we need to have separate versions of the patch for 8.5.x and 8.4.x?

We should be able to fix this at the DrupalCon Vienna sprints and get it into 8.4.0.

andrewmacpherson’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB
new17.76 KB

The patch in #95 applies against the 8.5.x branch and is RTBC-worthy IMO.

This patch applies to the 8.4.x branch, please review.

These interdiffs now show basically the same thing, the JS documentation tweak raised by #93.
#87 - #95 (for 8.5.x branch)
#87 - #101 (for 8.4.x branch)

mpdonadio’s picture

StatusFileSize
new17.76 KB
new17.76 KB

OK, for the sake of sanity, let's name the latest patches like this. Feel free to remove my commit credit as I didn't really do anything; these are just the other patches renamed.

dmsmidt’s picture

Assigned: Unassigned » dmsmidt
Issue tags: +Vienna2017
dmsmidt’s picture

Status: Needs review » Needs work

Bummer, found one nit. Gonna fix it in a bit.

+++ b/core/modules/system/tests/modules/form_test/form_test.routing.yml
@@ -467,6 +467,14 @@ form_test.group_vertical_tabs:
+    _title: 'Child element error vertical tabs testing'

+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Render/Element/VerticalTabsTest.php
@@ -0,0 +1,32 @@
+ * Tests that sessions don't expire.

Wrong test description.

dmsmidt’s picture

Assigned: dmsmidt » Unassigned
Status: Needs work » Needs review
StatusFileSize
new570 bytes
new17.78 KB
new570 bytes
new17.78 KB

Alright, I confirmed that #102 didn't change anything.
Then fixed the patches for both versions (docblock).

The last submitted patch, 105: 2848507-105-85x.patch, failed testing. View results

BarisW’s picture

Tested again, and it all works great.

Fieldset collapsed

Only local images are allowed.

Fieldset expanded

Only local images are allowed.

I also tested RTL and that works as expected as well.

The last submitted patch, 105: 2848507-105-85x.patch, failed testing. View results

andrewmacpherson’s picture

Status: Needs review » Reviewed & tested by the community

@dmsmidt and I have been discussing and watching this at the DrupalCon Vienna sprints, from the same table. The tests for both branch patches in #105 are green again, we looks like we had some random testbot blips. RTBC!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Core/Render/Element/VerticalTabsTest.php
@@ -0,0 +1,32 @@
+    $web_assert->elementTextContains('css', '.vertical-tabs__menu-item-title .child-error-indicator', '(contains error)');

I think we might need to wait here so that vertical tab javascript has had time to run. That's why #105 appears to have random errors. I think \Drupal\FunctionalJavascriptTests\JSWebAssert::waitForElement() might be what we need to use.

dmsmidt’s picture

Status: Needs work » Needs review
StatusFileSize
new749 bytes
new17.84 KB
new749 bytes
new17.85 KB

Alright, added the wait to the test. Better safe than sorry.

lauriii’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @alexpott for the guidance on the random errors.

The patch as a whole looks good for me now! The CR looks good as well. Thank you @dmsmidt and everyone else!

xjm’s picture

Are the screenshots in the summary current? The seven LTR screenshot looks like it's missing the right red border around the tab.

dmsmidt’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Novice

@xjm, good catch. Just checked, and yes they are recent.
Sadly marking this as 'Needs work' again.

xjm’s picture

Thanks @dmsmidt!

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andrewmacpherson’s picture

The 8.5.x branch doesn't apply cleanly anymore. It's the vertical tabs JS file, I'll update this.

andrewmacpherson’s picture

It was #2915784: 1/3 JS codestyle: camelcase that means patch #111 no longer applies. Should be an easy re-roll.

andrewmacpherson’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll

Here's the re-roll. I've only updated the 8.5.x patch from #111.

I'll have a look at the individual cases, and check screen shots are up to date. Confirm whether the Seven LTR vertical tabs issue is still a problem.

andrewmacpherson’s picture

Forgot to upload the patch.

andrewmacpherson’s picture

Confirmed that the LTR vertical tab is still a problem. The right border of the vertical tab does not have a red line.

I noticed that the right vertical tab border DOES become red on hover.

The RTL equivalent looks OK.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andrewmacpherson’s picture

Assigned: Unassigned » andrewmacpherson
Issue tags: +Needs reroll

Working on a re-roll now. Patch no longer applies due to JS format clean-ups, and #2854624: Details and accordion update based on Seven Style Guide

andrewmacpherson’s picture

Re-rolled the patch, ran JS prettier.
Going to look into the remaining problem with the LTR vertical tab border from #113.
There's also been some changes committed for the summary/details in Seven, so it's worth another round of manual testing, which could take me a few days.

Status: Needs review » Needs work

The last submitted patch, 124: 2848507-124-grouping-element-child-errors.patch, failed testing. View results

andrewmacpherson’s picture

Status: Needs work » Needs review
StatusFileSize
new1.17 KB
new17.1 KB

Fixes automated test failures: deprecated JavascriptTestBase, and a CSS file declared in Seven's library.
Still to do manual tests.

Status: Needs review » Needs work

The last submitted patch, 126: 2848507-126-grouping-element-child-errors.patch, failed testing. View results

andrewmacpherson’s picture

Status: Needs work » Needs review
StatusFileSize
new783 bytes
new17.29 KB

The last test failure was due to switching to WebDriverTestBase. It turns out that HTML5 client-side validation happens when using chromedriver, preventing the form submitting. Since we're checking that server-side error handling produces the .child-error-indicator span, I added a novalidate attribute to FormTestChildErrorVerticalTabsForm.

wim leers’s picture

idebr’s picture

Status: Needs review » Needs work
+++ b/core/misc/vertical-tabs.es6.js
@@ -300,7 +307,7 @@
-          ).text(settings.title)),
+          ).html(settings.title)),

+++ b/core/misc/vertical-tabs.js
@@ -138,7 +139,12 @@
-    tab.item = $('<li class="vertical-tabs__menu-item" tabindex="-1"></li>').append(tab.link = $('<a href="#"></a>').append(tab.title = $('<strong class="vertical-tabs__menu-item-title"></strong>').text(settings.title)).append(tab.summary = $('<span class="vertical-tabs__menu-item-summary"></span>')));
+    tab.item = $('<li class="vertical-tabs__menu-item" tabindex="-1"></li>').append(tab.link = $('<a href="#"></a>').append(tab.title = $('<strong class="vertical-tabs__menu-item-title"></strong>').html(settings.title)).append(tab.summary = $('<span class="vertical-tabs__menu-item-summary"></span>')));

These changes need XSS protection, since any text used in the title is now interpreted as html.

Preferably the title should stay as text and only the error markup is appended as html, so existing implementations remain unchanged.

dmsmidt’s picture

Assigned: Unassigned » dmsmidt

@idebr thanks for the review. Although I don't fully agree about the XSS.
The @title is sanitised in Drupal\Core\Render\Element\Details::preRenderDetails().

$element['#title'] = new TranslatableMarkup('@title <span class="visually-hidden child-error-indicator">(contains error)</span>', ['@title' => $element['#title']]);

And we currently allow adding HTML to translations strings in Drupal.
I can't see any other way that user input could lead to the (client-side) execution of code.

Working on the open styling issue.

dmsmidt’s picture

dmsmidt’s picture

Issue summary: View changes
dmsmidt’s picture

Version: 8.6.x-dev » 8.7.x-dev
Assigned: dmsmidt » Unassigned
Status: Needs work » Needs review
StatusFileSize
new14.31 KB
new20.71 KB

Finally found the time and courage to dig into this again.
- Fixed missing vertical tab border red as indicated by @xjm
- Removed usage of .html() in the JS like suggested in #130 @idebr (with no-js fallback)
- Updated CSS to work with all latest changes to the themes
- Improved test to also check if the count of the data attr is correct (fingers crossed)
- Different details error class names for Bartik vs Seven (in line with the rest of the class names)

I could use some cross browser testing help :-)

Status: Needs review » Needs work

The last submitted patch, 134: 2848507-134-grouping_element_child_errors.patch, failed testing. View results

andrewmacpherson’s picture

Thanks @dmsmidt! I'll try to find time for the cross-browser testing soon.

#131:

Although I don't fully agree about the XSS.
The @title is sanitised in Drupal\Core\Render\Element\Details::preRenderDetails()

But does that also count for the change in vertical-tabs.es6.js - the .html(settings.title)?

#134:

Fixed missing vertical tab border red as indicated by @xjm

Awesome, that was the only thing xjm blocked it on in #113.

dmsmidt’s picture

Thanks Andrew, testing appreciated ;-)

#131/#136:

But does that also count for the change in vertical-tabs.es6.js

Yes, somehow.. Only via translation interface we could get some html in, but we do that all the time with links.
But, I fixed it anyhow, so XSS should be no discussion anymore ;-)

Patch didn't apply because new Stylelint stuff was just committed. So, rerolled and fixed JS/Style linting.

idebr’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 137: 2848507-137-grouping_element_child_errors.patch, failed testing. View results

andrewmacpherson’s picture

Tagging for the global sprint this weekend. The Leeds (UK) meeting is having an accessibility focus, and the cross-browser testing is a good group activity.

andrewmacpherson’s picture

Issue tags: +Needs screenshots

Working on this at the Leeds UK sprint today.

Suesdesign’s picture

I applied patch 137 and tested the form on Mac OSX 10.14.2 with the Bartik theme and Seven theme with the following browsers:
Chrome 71.0.3578.98, Firefox 64.0.2, Safari 12.0.2 and Opera 58.0.3135.4. The results were correct and found to match the screenshots provided, so I did not provide new screenshots.

andrewmacpherson’s picture

Issue tags: -Needs screenshots

Thanks @Suesdesign, that's covered a lot of manual cross-browser testing.

We're working together at a sprint. Sue has also checked the LTR vs RTL scenarios.

We decided against getting screenshot evidence for every combination of browser and OS, because that would be a LOT. Instead we agreed to only provide screenshots if we found any differences.

Still ongoing:

  • checks at narrow breakpoints
  • Edge
  • IE11
nigelwhite’s picture

Tested on Linux 18.04

Browser Seven large Seven small Bartik large Bartik small
LTR RTL LTR RTL LTR RTL LTR RTL
Chrome pass pass pass pass pass pass pass pass
Firefox pass pass pass pass pass pass pass pass
andrewmacpherson’s picture

Crediting nigelwhite, part of the same QA effort in Leeds.

andrewmacpherson’s picture

andrewmacpherson’s picture

I'm doing testing in WIndows 10 today, to include Edge and IE11

nigelwhite’s picture

Here's another one on Linux 18.04. Drupal 8.7.0-dev. Patch 137

Browser Seven large Seven small Bartik large Bartik small
LTR RTL LTR RTL LTR RTL LTR RTL
Opera 58 pass pass pass pass pass pass pass pass
andrewmacpherson’s picture

Edge and IE11 have 2 problems affecting the details/summary grouping.

When the details group is closed:

  1. The text of the summary element doesn't become red,
  2. The disclosure triangle icon is missing.

Affects Seven and Bartik, RTL and LTR, whether inline_form_errors is enabled or not. I'll prepare a screenshot when I'm at the right machine.

A few months back there was a fix for a missing discosure triangle icon, which was related to normalize.css - maybe this is related to that too?

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

katannshaw’s picture

Hello. Is there any update on the status of this issue? I'd love to unblock this issue so that Inline Form Errors module can be enabled by default per [PP-1] Enable the Inline Form Errors module in the Standard install profile.

skaught’s picture

A concern is could be that html5 validation is on by default all forms. This actually blocks inline form error notices from running as expected. There is an issue for this. As well as a contrib module to bypass (https://www.drupal.org/project/disable_html5_validation)

Of course, you can simple change the status of the issue to 'needs work' -- we are all allowed to pickup an issue as you wish (:

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

dmsmidt’s picture

Assigned: Unassigned » dmsmidt
Status: Needs work » Active
dmsmidt’s picture

Assigned: dmsmidt » Unassigned
Status: Active » Needs review
StatusFileSize
new87.37 KB
new96.27 KB
new20.71 KB

Since this is still a blocker for IFE to be enabled by default (and an a11y issue) I'm picking this up again.

A long time has passed, so the latest patch needed a lot of love (please use a diff viewer for comparing patches, and save me an interdiff ;-)).
I also did a lot of linting / autofixing and improved some logic to be more compatible with different HTML structures per theme.

It fixes the last reported issues (supporting IE11).
See new screenshot:
IE11 fix details errors
Bartik converts details to vertical tabs, which do also work.
IE11 fix details vertical tabs

Since Claro is experimental, I would suggest to support it in a follow up.

@SKAUGHT #153, yes thanks for bringing that to my attention again. However this issue is not blocked by it.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

olivier.br’s picture

patch at #156 doesn't apply on 9.1.4, here is a reroll.

djsagar’s picture

StatusFileSize
new20.86 KB
new1.54 KB

Reroll patch with interdiff, Patch #157 is custom command failed.

catch’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
ankithashetty’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new20.81 KB
new441 bytes

Rerolled patch in #159, thanks!

Status: Needs review » Needs work

The last submitted patch, 161: 2848507-161.patch, failed testing. View results

nikitagupta’s picture

Status: Needs work » Needs review
StatusFileSize
new20.62 KB
new577 bytes
gekkie’s picture

This issue bit me today in a drupal8 project... Is this still a viable solution and will this get merged into core?

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

aleix’s picture

StatusFileSize
new15.1 KB

patch to be applied on 9.3

Status: Needs review » Needs work

The last submitted patch, 166: 2848507-166.patch, failed testing. View results

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

benjifisher’s picture

We discussed this issue briefly at #3258637: Drupal Usability Meeting 2022-01-21. That issue has a link to a recording of the meeting.

We would like to help this issue move forward. It is not clear what the next steps should be. I see that the most recent patch has a failing test, so I guess that needs to be addressed. This issue also has the tag for manual testing.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

yepa’s picture

StatusFileSize
new14.98 KB

Reroll the patch on 9.4.x

_utsavsharma’s picture

Status: Needs work » Needs review
quietone’s picture

Status: Needs review » Needs work

Patch does not apply.

_utsavsharma’s picture

Status: Needs work » Needs review
StatusFileSize
new2.04 KB
new14.97 KB

Fixed CCF for #172.

mgifford’s picture

Issue tags: +wcag331

Tagging for WCAG SC 3.3.1.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new145 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

kentr’s picture

Looking into re-rolling this for main.

kentr’s picture

Title: Indicate that grouping elements have child element errors for ux and a11y » [PP-1] Indicate that grouping elements have child element errors for ux and a11y
Status: Needs work » Postponed
Related issues: +#3582351: [Meta] Clean up CSS within Admin theme

I tried to rebase this recently and hit conflicts with Default Admin CSS.

Since Default Admin CSS is still very much in flux, I'm postponing on #3582351: [Meta] Clean up CSS within Admin theme.

Points 4 and 5 in that issue summary might stabilize it enough to allow work on this issue to proceed efficiently:

4. #3599680: Consolidate, merge, and refactor Gin's CSS variable's into Admin theme's original variables.
5. Remove any gin namespacing from CSS classes, including CSS selectors used in PHP and template files.

mherchel’s picture

Status: Postponed » Active
Issue tags: +Needs followup

There's going to be a bunch of work in default_admin CSS for a bit.

Lets create a followup issue specific for default_admin, and then make that a requirement of getting it stable. Then we can unblock this :)

mherchel’s picture

Can't add a comment since it's only a branch now, but don't forget to add the new variable to the twig templates' documentation.

kentr’s picture

Title: [PP-1] Indicate that grouping elements have child element errors for ux and a11y » Indicate that grouping elements have child element errors for ux and a11y
Issue summary: View changes
Status: Active » Needs work
Issue tags: -Needs followup
Related issues: +#3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y

Followup: #3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y

Can't add a comment since it's only a branch now, but don't forget to add the new variable to the twig templates' documentation.

Thanks. Will do.

mherchel’s picture

kentr’s picture

This is coming along. It looks like a lot of the Claro styles will transfer directly to Default Admin by just changing colors (so, doing Claro is fruitful).

I infer from #24 that the reason for reusing the page-top error block styling was for UX consistency. Based on that assumption, I've been restyling the previous work to match current error block styling with some adjustments for the specific context.

This screenshot is for Claro vertical tabs, with the invalid tab not selected:

Is work on Olivero postponed since it's in the process of being deprecated?

kentr’s picture

I'm using CSS custom properties, so because of #3599680: Consolidate, merge, and refactor Gin's CSS variable's into Admin theme's original variables. the Claro rules might mostly copy / paste right into Default Admin.

mherchel’s picture

Is work on Olivero postponed since it's in the process of being deprecated?

I would assume so. But feel free to do it. It'll need to get done in contrib if it doesn't get done here.

mherchel’s picture

I'm not sold on the 🚫 sign. IMO, the 🚫 is for "Don't do this".

A red asterisk would be more for "You're missing something important here".

That being said, reach out the the usability maintainers if you want, and see what they say. That being said I don't think this should hold anything up. We can always change it later.

kentr’s picture

@mherchel:

I'm not sold on the 🚫 sign. IMO, the 🚫 is for "Don't do this".
A red asterisk would be more for "You're missing something important here".

I hear you. Though, a red asterisk signifies required fields. In my mind, it would be confusing if the same symbol is used for validation errors.

Yeah, let's run it by UX in a bit.

FWIW, here's how I arrived at the icon:

Previously, the design (for the Seven theme) was:

Closed details element with red text, a full red border, and a red circle with a white x on the right side

Closed details element with red text, a full red border, and a red circle with a white x on the right side

In #24, @dmsmidt said (emphasis mine):

Design feedback / idea from the UX meeting of 15 march (see demo at: https://www.youtube.com/watch?v=lWKo_OK6gHg):

"Reuse the error message styling (thick left border)."

"In open state and IFE enabled the element becomes crowded."

Page-top error block with red text, a full red border, and a red circle with a white x on the left side

I reasoned that the UX team's intention was to use design elements from the page-top error block for the UX benefit of consistency. The linked video is no longer available, unfortunately. Note that the icon in the designs matches the icon in the image of the page-top error block.

However, the page-top error blocks are totally different now. Both Claro and Default Admin use a version of this "cross out" icon.

The icon in my comment #186 is the same icon that's in Claro's top error block:

page top error block in Claro

I took some liberties with the red color, though.

The red in the top error block is slightly lighter than the red used to mark invalid fields. I used the latter red for the text and border. The difference is small enough that to me the icon appears to be the same red (though it isn't).

Default Admin's top error block:

kentr’s picture

@mherchel:

Is work on Olivero postponed since it's in the process of being deprecated?

I would assume so. But feel free to do it. It'll need to get done in contrib if it doesn't get done here.

I rescoped this issue so that it gets done and can be applied to Default Admin more quickly.

Olivero followup: #3605962: [PP-1] Indicate that grouping elements have child element errors for ux and a11y, Olivero.

kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

@mherchel,

I may be able to get rid of the template changes by using a theme-agnostic CSS error class like this (which would eventually apply to Default Admin, and probably Olivero):

.claro-details.error:not([open]) > .claro-details__summary

instead of:

.claro-details--child-error:not([open]) > .claro-details__summary

Using the error class on the details element is also more consistent with how it's used on the fieldset of a group of checkboxes / radios.

Are you OK with that?

mherchel’s picture

Yeah, if it works do it. Also feel free to use the :has() selector in this (I feel like that could help).

kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
mgifford’s picture

As discussed in Slack with @quietone

kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
kentr’s picture

kentr’s picture

Issue summary: View changes
Issue tags: +Needs usability review

I think this is ready for usability / UX review to evaluate the general direction.

The CSS still needs some work. The icon in the details is vertically-centered, whereas in the previous proposed solution it was inline with the first line of the summary element.

This is only because I haven't managed to position it correctly yet.

kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
StatusFileSize
new12.36 KB
kentr’s picture

Issue summary: View changes
kentr’s picture

Issue summary: View changes
Status: Needs work » Needs review

Marking Needs review to put it in the UX group's todo list.

kentr’s picture

Status: Needs review » Needs work
Related issues: +#2859914: Misleading Icon used on form validation errors

This was discussed in the UX meeting today.

I'll start working on the changes. I'll let someone from the UX team remove the "Needs usability review" tag.

Related: #2859914: Misleading Icon used on form validation errors

I just discovered that Olivero also uses the cross out icon for form top error blocks:

I believe the UX team will have a recommendation on whether it's better to be consistent with the error icons for the grouping elements and change them later holistically versus using different icons for the grouping elements.

rkoller’s picture

StatusFileSize
new47.05 KB

Usability review

We discussed this issue at #3609715: Drupal Usability Meeting 2026-07-17. The link to the recording: https://www.youtube.com/watch?v=oD9o5dkfjeo. The attendees at the usability meeting were @kentr, @rkoller, @simohell, and @worldlinemine.
Going through the steps to reproduce section within the issue summary we've noticed a few potential problems to denote.

  • The width of the left border indicating either an active or error state for a parent element is inconsistent across the three given examples. On the "standard" details element the expanded active parent element does not have any indication with a blue border on the left for (*would not necessarily make sense here to be fair). Accordion style detail elements in the advanced sidebar on node edit forms have a thinner left blue border in the active state compared to a wider left red border on elements in the error state. While on vertical tabs the left border for detail elements in the active and the error state have an identical width.
  • If an active vertical tab is right next to one in the error state the color contrast between the two colors is rather low and in consequence it makes them extremely hard to differentiate by just focusing on the left borders. https://www.whocanuse.com/?bg=203ac7&fg=c83f2d&fs=16&fw=. Plus, the color red alone for the error state can be problematic for people with cataracts, low vision or within direct sunlight and or night shift mode https://www.whocanuse.com/?bg=ffffff&fg=c83f2d&fs=16&fw=.
  • For sighted users the styling for the error state is dropped in the expanded state, while in the aural interface the labelling (contains errors) is kept for the expanded AND collapsed state. The removal of the styling for the error state is not "necessarily" an issue for the "standard" details elements scenario nor the accordion style detail elements in the advanced sidebar on node edit form, there the state isn't changed often or at all. But if a vertical tab with child element(s) failing the validation becomes active the styling is changed from the error state to the active state, and if you switch again to another vertical tab the styling of the current vertical tab changes back to the styling for error states. That makes the navigation in between vertical tabs on examples like /admin/config/people/accounts visually busy and extremely cognitively challenging - people with a small working memory are in trouble here. Strictly speaking there is the need for a design for an active error state, because otherwise you never really know for sure what the actual active vertical tab is.
  • The group was in line with the comment in#189. The association one has looking at a prohibition sign is not necessarily that of an error. Aside that, it also has to be noted that /admin/reports/status is using a different kind of icon for the error state - the iconography should be consistent across the entire admin UI, otherwise it creates ambiguity and increases the cognitive load.
  • In addition to the icon choice for the error state there is also the problem of proximity. At the moment, the label for the parent element in the error state is left aligned while the prohibition sign is aligned to the right. Depending on the length of the label, the gap in-between the label and the icon for the accordion detail elements and the vertical tabs is more or less within the bearable limits. But in particular for "standard" detail elements that gap could become a significant barrier on wider viewports. If you are color blind, and color is not a distinguishing factor for you, and you apply the straw test things get quiiiite challenging to recognize with the glimpse of an eye if a collapsed parent element is in the error or active state.

The group agreed on suggesting the following points:

  • Follow the pattern used on the accordion detail elements and use the thinner width for the active state in blue and the wider width for the error state in red and make things consistent across all the three given scenarios. To use the differing width as an additional visual cue aside the difference in color so users are able to distinguish the active and error state more easily.
  • Same as keeping the visually hidden label (contains errors) available in the aural interface for the expanded and collapsed state of a parent element, the styling for the error state should be kept in the expanded and the collapsed state for sighted users. Strictly speaking there is even the need for an active error state, which is most important and sort of mandatory in the context of vertical tabs - design input is required in this case. Otherwise it would be impossible to determine the active vertical tab in the following example - you would never know which of the six vertical tabs is the active one.
  • nine vertical tabs for emails on the account configuration page in the claro theme, with the first two tabs styled in the error state, the third as active, and the next three underneath in the error state again, while the last three are in no particular state

  • The iconography used across the Drupal admin interface for errors, warnings and informational states on /admin/reports/status, admin messages, and on for example errors on this issue should be consistent. The easiest fix for the error state, instead of using the prohibition sign is to simply use the "x" icon used on the status reports page for error admin messages and errors on parent elements as well. Our suggestion is not about the visual presentation, the question "should it be just an X" or "should there be a circle around the X", all that should be up to the designers. Our only concern is about providing a consistent clear iconography across all contexts of the admin UI for the error, warning and informational state. A related and already existing issue that was found during the meeting is #2859914: Misleading Icon used on form validation errors.
  • The icon for the error state should be in close proximity to the element label, either right before or right after the label - that might also require design input.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

kentr’s picture

Status: Needs work » Needs review
StatusFileSize
new60.64 KB
new87.46 KB
new73.62 KB

@rkoller, thanks for the excellent summary!

Notes for next UX / Usability review

This is ready UX review again to determine if it's good enough to go as-is or what is the MVP.

There are a few things that are status quo which we may not have the authority to change here without high-level sign-off:

  1. The "cross out" [edit: aka "prohibition"] icon in the error block at the top of the page.
    I previously used that icon in the new styling here for consistency within forms. Now there is consistency with the status page but inconsistency within the form.
  2. The missing blue left border and blue coloring for open "standard" details.
  3. The thicker blue left border for selected vertical tabs. The red error border is the same width in all cases, but the thicker blue border for vertical tabs makes the difference harder to see.

Also, the problem raised in #2859914: Misleading Icon used on form validation errors is that the "X" icon implies clicking it will make something go away. Maybe we should reevaluate the priority of #2859914: Misleading Icon used on form validation errors to establish a better error icon all around?

Here are new screenshots of the top error block, vertical tabs, "accordion" style details, and "standard" details, respectively.

Here's a screenshot of the status quo top error block and new screenshots of vertical tabs, "accordion" style details, and "standard" details, respectively.

Strictly speaking there is even the need for an active error state, which is most important and sort of mandatory in the context of vertical tabs - design input is required in this case. Otherwise it would be impossible to determine the active vertical tab in the following example - you would never know which of the six vertical tabs is the active one.

Yeah. I need direction regarding the change. Maybe a small half-circle protruding from the border like in the Navigation module active menu items?

Edit: Or both a blue and red left border?

kentr’s picture

Issue summary: View changes
kentr’s picture

I reopened and repurposed #2859914: Misleading Icon used on form validation errors to apply to the prohibition sign.

We'll need to sort it out for #3604037: [PP-1] Indicate that grouping elements have child element errors for UX and a11y because Default Admin uses the prohibition sign even on the status report page:

screenshot of three summary blocks at the top of the status report page in the default admin theme

kentr’s picture

Possible correction to #213:

The red error border is the same width in all cases

The thick red left border might be a little thinner on the vertical tabs. The details elements also have a red border on the container that may be adding to the total width of the thick red left border.

I'll look into it.

kentr’s picture

I reverted the icons to the prohibition icon based on @rkoller's comment in Slack:

in regard to the icon. in particular in the context of vertical tabs the ressemblance of the x icon is quite close to the quite button on not necessarily in drupal uis but in for example macos. so people might be reminded to that. it looks like it would be possible to close the vertical tab with that x button. that brings me back to the general iconography. maybe the prohibition icon should be kept otherwise this issue might be blocked forever  while the discussion about the iconography choice should happen in the issue that got dug up...

kentr’s picture

Status: Needs review » Needs work

Needs work, also, per #213, #216, and the fact that Safari puts these icons at the beginning of the vertical tabs title instead of the end.

I'm working on them.

kentr’s picture

Issue summary: View changes
Status: Needs work » Needs review

Ready for another UX review.

Changes since last review

  1. Changed the icon back to the prohibition icon.
  2. Fixed the icon position for vertical tabs in Safari.
  3. Increased the width difference for the vertical tabs left error border by reducing the left blue active border width. The left blue border width for active vertical tabs now matches the left blue border with for open accordion-style details.

UX & Accessibility Questions

  1. For vertical tabs, is the difference in border width now sufficient?
  2. Any suggestions for making the active error state more apparent (#212, point 3)? Is this problem a blocker?
  3. What are remaining blockers for this to be acceptable in a beta state?
    IIUC, the 11.5.0-beta1 release date is pretty soon.
    Since this is blocking #2915899: [PP-1] Enable the Inline Form Errors module in the Standard profile and recipe and we want to get that into 11.5.0, I assume we need to make this beta-ready by the 11.5.0 beta deadline.

New screenshots

Claro vertical tabs, LTR:

Claro details, accordion style, LTR:

Claro details, standard, LTR:

Claro vertical tabs with summary, LTR, open:

Note: It's not possible to see this in the MR.

benjifisher’s picture

We discussed this issue at #3611503: Drupal Usability Meeting 2026-07-24. That issue has a link to a recording of the meeting. I am giving issue credit here to the attendees at the usability meeting: benjifisher, kentr, and rkoller.

In Comment #220, I think the first question is more about accessibility than usability.

We can revisit this issue soon, especially if kentr can attend the meeting again.

kentr’s picture

Issue summary: View changes
kentr’s picture

In Comment #220, I think the first question is more about accessibility than usability.

I edited the heading (and the list).

Not sure that I'll be able to attend the next meeting.

kentr’s picture

Issue summary: View changes
mherchel’s picture

This is looking great. As far as I can tell, this is the last blocker for #2915899: [PP-1] Enable the Inline Form Errors module in the Standard profile and recipe.

I'd also like to say that this is such a major improvement in both UX and accessibility, be wary of trying to make it perfect. We can always defer non-critical issues (e.g. thickness of border).

Thanks for picking up the torch on this one @kentr

kentr’s picture

The border thickness was about differentiating the blue & red borders (because color alone isn't sufficient).

I should have copied this from Slack earlier:

in regard of the width of the left border. to me the difference in width is not clearly apparent. so not sure if it would work as a visual cue aside the color to differentiate the two?

Though, it seems that the icon is also a visual cue to differentiate the containers with errors.

And now that I think about it:

If the icon by itself is enough to differentiate error from non-error, then perhaps left border thickness can be repurposed to differentiate active error from inactive error states.

kentr’s picture

Issue summary: View changes

I'm going to put up an MR for another option so that they can be compared:

Option 2

  • Details and vertical tabs inactive error state: Let the icon be the non-color visual cue and use a thinner side border (same width as the blue side border for open accordion details and active vertical tabs).
  • Vertical tabs active error state: Use a thicker red side border to differentiate from the standard error state.

kentr’s picture

Issue summary: View changes
StatusFileSize
new1.83 MB

I put up the MR for option 2 and attached a brief video of the different elements in place of screenshots.

kentr’s picture

Issue summary: View changes
Status: Needs review » Needs work
StatusFileSize
new154.53 KB

I'm hiding Option 2 because IIUC the UX team preferred Option 1, and changing to Needs work in wait of the official UX team summary.

Per the recording of the 2026-08-07 usability meeting, I used a darker gray for the vertical tabs active item border.

The CSS variable used is --input-border-color, which resolves to #919297 / --color-gray-500.

Kudos to the meeting participants for tracking down the variable that needed changing!

Screenshot:

Vertical tabs containing invalid fields, in Claro, with one of the error tabs selected and a darker gray border.

kentr’s picture

From the meeting recording, it sounded to me like we're almost there. But I do want to ensure that I didn't miss anything.

benjifisher’s picture

Usability review

We discussed this issue at #3614155: Drupal Usability Meeting 2026-08-07. That issue has a link to a recording of the meeting. I am giving issue credit here to the attendees at the usability meeting:benjifisher, rkoller, simohell, and the_g_bomb.

We preferred Option 1, but either way, the remaining usability issue is how to indicate the active vertical tab, especially when it does not have focus. The thicker left border is not enough for all users. (Let's not quibble about whether that is an opinion on UX or a11y.)

We agreed that a good solution would be to use a darker shade of gray for the border of the content area and the top and bottom borders of the active vertical tab. Probably the same shade of gray that is used for the border of (unfocused) input elements would work well. When the vertical tab has focus, the focus highlighting should override the top and bottom borders.

We did not agree on whether making that change should be a blocker for this issue. On one hand, we kept Comment #225 in mind. On the other hand, the main branch does not have this problem: since there is no error indication on the vertical tab, there is no conflict with the indication of the active tab, so this problem is a regression from the main branch.

It seems that disagreement is moot: kentr already reviewed the recording of the meeting and, judging by the screenshot in Comment #230, implemented the suggestion.

I hope the improved contrast in the border applies all the time, not just when there are errors. If not, that can be deferred to a follow-up issue; perhaps it can be done as part of #3424484: Improve the color contrast for structural interface components. I am adding that as a related issue.

One other thing we noticed while testing is that the focus indicator on vertical tabs should use a complete border, as it does for input elements, not just the top and bottom borders. We did not check whether there is already an issue for that. We are not suggesting that it be fixed as part of this issue.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

kentr’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs accessibility review
StatusFileSize
new105.53 KB

Let's not quibble about whether that is an opinion on UX or a11y

Both, perhaps?

I hope the improved contrast in the border applies all the time, not just when there are errors.

The improved contrast in the border [color] does apply all the time:

Vertical tabs in Claro showing darker gray border of an active tab without child errors.

I'm removing Needs accessibility review because members of the accessibility team were present in the UX meetings and I think we've addressed all of the points that were raised.

One other thing we noticed while testing is that the focus indicator on vertical tabs should use a complete border, as it does for input elements, not just the top and bottom borders. We did not check whether there is already an issue for that. We are not suggesting that it be fixed as part of this issue.

Yeah, to me that should be a separate issue because it's preexisting [edit: and not related to showing that a grouping element has a child error].

So, I think that we've also addressed the outstanding UX problems [edit: but that's the UX team's call].

When the UX team removes Needs usability review, I believe this will be ready for a more general review (including code).

mherchel’s picture

Which MR needs review?

Note that I took a look at the code (didn't test out the functionality yet), and the first thing I noticed in the CSS is that the icons don't adapt to forced-colors.

To make that work, we should be using mask-image instead of background-image, and then setting the background color to red. From there we can add a forced-colors media query that will set the background color to canvasText, which is a CSS system color that the browser will adapt to whatever color is needed.

kentr changed the visibility of the branch 2848507-grouping-elements-child-errors-opt-2 to hidden.

kentr’s picture

Issue summary: View changes
Status: Needs review » Needs work

Needs work for forced-colors (#234).

I hid the branch for Option 2. There's only one MR now.

kentr’s picture

Status: Needs work » Needs review
StatusFileSize
new134.18 KB
new61.17 KB
new59.66 KB

I implemented forced-colors for the icons, including using mask-image for the full-color version.

Though for the full-color version, I used the same red color as the text & border instead of the color of the icon SVG.

Vertical tabs have other problems in forced-colors, but they are preexisting.

Screenshots:

Vertical tabs:

Accordion style details:

Standard details:

benjifisher’s picture

Issue tags: -Needs usability review

We did not have a quorum for #3615346: Drupal Usability Meeting 2026-08-14, but @rkoller and I tested the current MR for this issue. We agreed that, with the improved indicator for the active vertical tab (screenshot in Comment #230) there are no usability problems blocking this issue. I am removing the tag for a usability review.

kentr’s picture

Issue summary: View changes
mgifford’s picture

@benjifisher I assume from this that we can also remove "Needs manual testing"

What else is outstanding, aside from the final review?

kentr’s picture

Issue summary: View changes
Issue tags: +Needs change record

It should probably have manual testing for the RTL cases (and maybe screenshots).

I think it also needs a change record, based on When a change record is needed or not:

  • When the change impacts the User Interface (UI), including CSS changes.
  • A change in the user experience.

I updated the remaining tasks in the issue summary and will work on the change record.

kentr’s picture

Ah, there's already a draft change record.

kentr’s picture

Issue summary: View changes
Issue tags: -Needs change record updates

I think the CR is good to go.

kentr’s picture

Issue summary: View changes
gwenweb’s picture

Tested the RTL cases manually using the Hebrew language (Locale module enabled, URL prefix /he/).

Scenario 1 : Standard details (/he/form_test/details-contains-required-fields)
Submit closes a details with errors. Error indicator visible on closed details.

screenshot submit closes a details with errors

Scenario 2 : Accordion (node edit)

URL alias without leading slash, Save, close "URL alias" details. Error indicator visible, no false positives on sibling details.

sceenshot url alias without leading slash

Scenario 3 : Vertical tabs (/he/admin/config/people/accounts)

Tested inactive error tab

screenshot inactive error tab

and active error tab

screenshot active error tab

Forced-colors mode (emulated via DevTools)

Icon renders correctly on details

screenshot forced-colors mode renderring icon on details

and vertical tabs

screenshot vertical tab forced-colors renderring icon

DOM check

  • data-child-error-count correct on <details>, but not found on <li class="vertical-tabs__menu-item">. Is this intentional?

    screenshot code data-child-error-count on details

    screenshot no data-child-error-count on li

  • (contains error) visually-hidden text present in both details summary and vertical tab label.

    screenshot span contains error visually hidden

    screenshot visually-hidden text code

CSS uses logical properties throughout (inset-inline-*, border-inline-*). RTL positioning looks correct.

kentr’s picture

Thanks @gwenweb.

data-child-error-count correct on <details>, but not found on <li class="vertical-tabs__menu-item">. Is this intentional?

Not sure. Let me see if I broke that, or if it was like that when I picked it up.

Behind the scenes, vertical tabs are progressively-enhanced details elements, and the corresponding details does have it:

Vertical tab content item without CSS, with the corresonding DOM details element highlighted in devtools.

The only harm I can see with putting it on the li element is more complexity. Themes can also get it in the JavaScript theme function if they need it.

kentr’s picture

Status: Needs review » Needs work
kentr’s picture

Issue summary: View changes
Status: Needs work » Needs review

RE the question about the data-child-error-count attribute from #245:

data-child-error-count correct on <details>, but not found on <li class="vertical-tabs__menu-item">. Is this intentional?

IMO it was either intentional or it's not a problem currently.

I updated the proposed resolution and am setting back to Needs review to reflect this.

Rationale

  1. I reapplied patch #175 to core/misc/vertical-tabs.js from main and used that with the rest of this MR in the Stark theme.

    The result did not include the data-child-error-count attribute on the lielement.
    Here's the markup (formatted oddly to make the attributes more readable):

    <li 
      class="vertical-tabs__menu-item vertical-tab__menu-item--child-error first" 
      tabindex="-1"
      >
      <a 
        href="#edit-email-admin-created">
        <strong 
          class="vertical-tabs__menu-item-title"
        >
            Welcome (new user created by administrator)
            <span 
              class="visually-hidden child-error-indicator"
            >
              (contains error)
          </span>
        </strong>
          <span 
            class="vertical-tabs__menu-item-summary"
          >
          </span>
      </a>
    </li>
    
  2. No tests are failing (so the attribute isn't expected in a test).
  3. There aren't any JavaScript console errors, either in Stark or in Claro (which uses its own theme function that's in the MR).
  4. The details element in the DOM that corresponds to the li element does have the attribute.
  5. There's no apparent use-case at the moment.
  6. This details node is also passed to the JavaScript theme function, so it should be easy for themes to get that attribute / value if they need it.
kentr’s picture

Issue summary: View changes

I added the screenshots from #245 to the IS and changed the ordering of those that were already there.

kentr’s picture

Issue summary: View changes
Issue tags: -Needs manual testing

Also AFAIK this doesn't currently need more manual testing. I may be wrong and / or that may change in the future.

Probably the CSS needs to be cleaned up.

I want to get feedback from the people who really know cutting-edge CSS and Drupal's CSS conventions before I spend more time on that, so that I go down the right path.

mherchel’s picture

I'll put this on my todo.

I'm not terribly worried about 100% perfect CSS, because 1) Claro's about to be removed from core, and 2) Claro's CSS quality is all over the place.

kentr’s picture

Can this be RTBC based on #238, #245, #248, and #251?

Core committers will look at the code, anyway.