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),
            ],
          ],
        ];

Issue fork commerce-3540484

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

jsacksick created an issue. See original summary.

jsacksick’s picture

Issue summary: View changes

  • jsacksick committed 210a9cd1 on 3.x
    [#3540484] feat: Add a "details_open" wrapper element options to...
jsacksick’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.