If the field is #disabled then pass #default_value in valueCallback

Created on 17 November 2024, 8 months ago

Problem/Motivation

If you use this field element in Form API and set it as #disabled, when the form submits, the #default_value is not passed, so the value is empty in the form submit handler.

Steps to reproduce

  1. Create a form using this field using Form API
  2. set a default value on the field and disable the field
  3. when you submit the form look at the form_state, and the value submitted for this field will be empty.

Proposed resolution

Pass the #default_value in the valueCallback method in PhoneInternationalElement class.

🐛 Bug report
Status

Active

Version

3.3

Component

Code

Created by

🇬🇧United Kingdom joehuggans Harrogate, UK

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