Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Jan 2013 at 04:08 UTC
Updated:
29 Jul 2014 at 21:45 UTC
In some cases in the Simpletest UI, non-collapsing fieldsets were used. Switching them to details makes it too easy to accidentally collapse them, since the click target is much better.
Before:


After:


| Comment | File | Size | Author |
|---|---|---|---|
| after-results.png | 27.07 KB | tim.plunkett | |
| after-clean.png | 18.74 KB | tim.plunkett | |
| before-results.png | 14.05 KB | tim.plunkett | |
| before-clean.png | 14.98 KB | tim.plunkett | |
| simpletest-ui-fieldsets.patch | 1.36 KB | tim.plunkett |
Comments
Comment #1
sunComment #2
mgiffordI'm not arguing that this is something that shouldn't be collapsible. There are definitely some strange things in how browsers are implementing
<details>and I do agree that this is a likely usability problem.What we need though, I think, is a pattern to make
<details>non-collapsible. Reverting to<fieldsets>is just going to make things confusing for everyone.If what we are trying to do is visually offset an item on a page in a box, then we should be using
<details>.<fieldsets>are intended to "group related elements in a form". Fieldsets should be used with<legend>where possible to provide additional context about the relationship of the form items within the fieldset."The HTML element is used to group several controls as well as labels () within a web form." - Mozilla
"The fieldset element represents a set of form controls grouped under a common name." - W3C
So why are we reverting back to the hack that was implemented (maybe in Drupal 4) to use fieldsets as visual blocks for admin items on a page? Lets just fix the behavior of details using Javascript until the HTML5 spec comes up with some way to specify a non-collapsible attribute for
<details>.Comment #3
nod_non collapsible details just won't happen. That's the whole point of the element. What you're describing is a fancy div.
Comment #4
mgifford@nod_ even easier. Any reason not to just use a styled div tag rather than a fieldset?
Comment #5
sun@mgifford:
The Simpletest module UI rarely sees any patches and has a developer audience only. Can we move your proposal into a new issue, please?
I think what you're saying makes sense though. That said, we arrived at a fairly similar conclusion over in #1829202: Make #type 'item' work outside of a form context to render a compound label + content — so perhaps we might even want to repurpose that issue, to generally replace #type details + fieldset + item throughout core with #type container + #title support, in cases where details/fieldset is not appropriate.
Comment #6
mgiffordThis isn't a central issue and although it isn't a best practice it isn't really significant barrier either. It's more the pattern in this case I was worried about not it's application with Simpletest.
So, yes @sun thanks for the clarification and I'll try to follow-up in the other issue.
Comment #7
webchickI don't mind committing this as a one-off, but I agree with mgifford that we're really sorely lacking some documentation around fieldsets vs. details and when to use what. I filed #1892968: Fieldsets vs. Details: When to use what and why? as a major follow-up task.
Committed and pushed to 8.x.