Consider defining SDC components as FormElement

Created on 7 June 2023, about 1 year ago
Updated 7 June 2024, 21 days ago

Problem/Motivation

SDC intentionally removes the ability to extend and modify components which is great for the frontend but not great for an admin interface if another module wants to modify the behavior of the form element.

Proposed resolution

Replace instances like

    $form['button_group']['settings'] = [
      '#type' => 'component',
      '#component' => 'same_page_preview:settings-button',
      '#props' => [
        'iconType' => 'settings',
        'label' => 'Settings',
      ],
    ];

with

    $form['button_group']['settings'] = [
      '#type' => 'same_page_preview_settings_button',
      '#props' => [
        'iconType' => 'settings',
        'label' => 'Settings',
      ],
    ];

using a class like

class SamePagePreviewSettingsButtonElment extends FormElement {

  /**
   * {@inheritdoc}
   */
  public function getInfo() {
    ......
  }
✨ Feature request
Status

Active

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States ctrlADel North Carolina, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024