Describe your bug or feature request.
We provide a "details" => "Details (closed)" wrapper element option because the "details" element by default is closed.
We can provide a "details_open" option, and then set the #open attribute to true when "details_open" is chosen.
This is the code that needs to change:
/**
* Gets the "wrapper_element" allowed options.
*
* @return array
* The "wrapper_element" options.
*/
protected function getWrapperElementOptions(): array {
return [
'container' => $this->t('Container'),
'fieldset' => $this->t('Fieldset'),
'details' => $this->t('Details (Closed)'),
];
}
And then:
$form['sidebar'][$pane_id] = [
// Workaround for core bug #2897377.
'#id' => Html::getId('edit-' . $pane_id),
'#parents' => ['sidebar', $pane_id],
'#type' => $pane->getWrapperElement(),
'#title' => $pane->getDisplayLabel(),
'#attributes' => [
'class' => [
'checkout-pane',
'checkout-pane-' . str_replace('_', '-', $pane_id),
],
],
];
Comments
Comment #2
jsacksick commentedComment #5
jsacksick commented