dependsOn issues with list element
aschempp opened this issue · 2 comments
aschempp commented
I have a custom element with a list of links (maxItems = 2). The radio button triggers a dependsOn
to switch between a text link field and a form select menu. Everything works fine, except for the case when clicking Neues Element
. Then the first radio button also controls the second dependsOn
, until I reload the page.
Definition looks like this:
return [
'label' => ['Links', 'Sie können bis zu zwei Links zum Element hinzufügen.'],
'elementLabel' => '%s. Link',
'inputType' => 'list',
'maxItems' => 2,
'fields' => [
'type' => [
'label' => ['Aktion', 'Wählen Sie den Aktions-Typ'],
'default' => 'link',
'inputType' => 'radio',
'options' => ['link' => 'Link', 'form' => 'Formular'],
'eval' => ['mandatory' => true, 'tl_class' => 'w33'],
],
'form' => [
'label' => ['Formular', 'Wählen Sie das Formular, welches im Popup angezeigt werden soll.'],
'inputType' => 'select',
'foreignKey' => 'tl_form.title',
'eval' => ['mandatory' => true, 'includeBlankOption' => true, 'tl_class' => 'clr w50'],
'dependsOn' => [
'field' => 'type',
'value' => 'form',
],
],
'url' => [
'label' => ['Link-Adresse', 'Geben Sie eine Web-Adresse (https://…), eine E-Mail-Adresse (mailto:…) oder ein Insert-Tag ein.'],
'inputType' => 'text',
'eval' => ['mandatory' => true, 'rgxp' => 'url', 'dcaPicker' => true, 'tl_class' => 'clr w50'],
'dependsOn' => [
'field' => 'type',
'value' => 'link',
],
],
'linkTitle' => [
'label' => ['Link-Titel', 'Geben Sie den Titel für den Aktions-Button ein.'],
'inputType' => 'text',
'eval' => ['mandatory' => true, 'tl_class' => 'w50'],
],
],
];
ausi commented
ausi commented
Released as version 2.4.5