Fix bad position of selected option

This commit is contained in:
Laurent Destailleur 2024-07-27 19:32:02 +02:00
parent 8ac368ce17
commit 07079fc239

View file

@ -8707,7 +8707,7 @@ class Form
}
} else {
$id = (string) $id; // if $id = 0, then $id = '0'
if ($id != '' && ($id == $key || ($id == 'ifone' && count($array) == 1)) && !$disabled) {
if ($id != '' && (($id == (string) $key) || ($id == 'ifone' && count($array) == 1)) && !$disabled) {
$out .= ' selected'; // To preselect a value
}
}