Give support for '#diasabled property in address_country form element

Created on 23 December 2024, 1 day ago

Problem/Motivation

The address_country form element does not support the Form API native '#disabled' property, hence it is not possible to disable the internal country dropdown.

Steps to reproduce

Create form element like this:

$element['country_code'] = [
  '#type' => 'address_country',
  '#title' => t('Country'),
  '#available_countries' => $element['#available_countries'],
  '#default_value' => $element['#default_value']['country_code'],
  '#required' => $element['#required'],
  '#disabled' => TRUE,
];

We expect that the select element is create, but disabled, preventing users to edit the element, but it does not happen.

Proposed resolution

Give support for that property, in a similar way it is provided for other properties like '#required' or '#default_value'

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇪🇸Spain plopesc Valladolid

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024