HTML5 adds support for a <details>
element. The element creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label must be provided using the <summary>
element.
Backdrop currently uses the HTML <fieldset>
element with custom JavaScript, to achieve a similar result. The <details>
element has native browser support, without the need for JavaScript.
<?php$form['fieldset'] = array( '#type' => 'fieldset', '#title' => t('Summary'), '#description' => t('Longer description within.'), '#collapsible' => TRUE, '#collapsed' => TRUE,);?>
After:
<?php$form['details'] = array( '#type' => 'details', '#summary' => t('Summary'), '#details' => t('Longer description within.'), '#open' => TRUE,);?>
Introduced in branch:
1.x
Introduced in version:
1.20.0
Impacts:
Module developers
Related Github Issues: