Skip to content

Commit b9dac43

Browse files
committed
Initialize choices on the wrapper (^5.5.12 FC)
1 parent 8a682aa commit b9dac43

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"php": "^8.2",
2727
"ext-json": "*",
2828
"ext-dom": "*",
29-
"contao/core-bundle": "^5.3",
29+
"contao/core-bundle": "5.3.* || ^5.5.12",
3030
"doctrine/dbal": "^3.3",
3131
"psr/log": "^1.1 || 2.0 || ^3.0",
3232
"symfony/config": "^6.4 || ^7.2",

src/Widget/ComponentStyleSelect.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ public function generate()
223223
if (!!$objStyleGroup->chosen)
224224
{
225225
$strClass .= ' tl_chosen';
226-
$this->arrAttributes['data-controller'] = 'contao--choices';
227226
}
228227

229228
// create a collection
@@ -242,7 +241,7 @@ public function generate()
242241
}
243242

244243
$arrCollection[ $collectionAlias ]['fields'][] = sprintf('%s%s<select name="%s" id="ctrl_%s" class="%s%s"%s data-action="focus->contao--scroll-offset#store">%s</select>%s%s',
245-
(str_contains($objStyleGroup->cssClass ?? '', 'separator') ? '<hr>' : '') . '<div' . ($objStyleGroup->cssClass ? ' class="' . $objStyleGroup->cssClass . '"' : '').'>',
244+
(str_contains($objStyleGroup->cssClass ?? '', 'separator') ? '<hr>' : '') . '<div' . ($objStyleGroup->cssClass ? ' class="' . $objStyleGroup->cssClass . '"' : ''). (!!$objStyleGroup->chosen ? ' data-controller="contao--choices"' : '') .'>',
246245
'<h3><label for="ctrl_' . $strFieldId . '">' . $objStyleGroup->title . '</label></h3>',
247246
$strFieldName,
248247
$strFieldId,

0 commit comments

Comments
 (0)