Unable to select the empty option

Created on 5 March 2024, 8 months ago
Updated 18 March 2024, 8 months ago

Problem/Motivation

The icon picker field, when set to "Optional," offers an "empty" option. However, selecting "empty" and saving the content results in the first option being selected instead. Additionally, the "empty" option is not present within the input field itself, as revealed by inspecting the code..

Proposed resolution

In the file Element/FontIconpicker.php, line 34 introduces the processFontIconpicker function. However, this function executes after the processSelect function, preventing the "empty" option from being added to the input field.

To address this issue, modify line 34 as follows:

$info['#process'] = array_merge([[$class, 'processFontIconpicker']], $info['#process']);

This code effectively merges the processFontIconpicker function into the existing #process array, ensuring it runs before processSelect. This, in turn, guarantees the successful addition of the "empty" option to the input field.

🐛 Bug report
Status

Fixed

Version

1.1

Component

Code

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

Comments & Activities

Production build 0.71.5 2024