Skip to content

Commit 739c977

Browse files
admin: tree selection now expands lazily loaded branches
- the JS item template was rendered without the children container because the '__expandable__' placeholder never equaled 'true', so children of items created via AJAX were appended into an empty jQuery set and never reached the DOM - affected every branch not pre-rendered on the server, e.g. a third level category on product detail when the product is not assigned in that branch
1 parent d2c504c commit 739c977

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

assets/js/admin/components/TreeSelectionFormItem.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ export default class TreeSelectionFormItem {
141141

142142
$newItem.data('load-url', itemData.loadUrl);
143143
$newItem.data('expandable', itemData.isExpandable);
144+
if (!itemData.isExpandable) {
145+
$newItem.find('.js-tree-selection-form-children-container:first').remove();
146+
}
144147
if (itemData.isVisible === false) {
145148
$newItem.addClass($form.data('hidden-item-class'));
146149
}

0 commit comments

Comments
 (0)