Fix: pendingSelections sync and chips toolbar display

1. Fix Select All not persisting in list view:
   - Updated Select All handler to populate pendingSelections array
   - Updated Clear selection handler to clear pendingSelections for list view
   - Updated dropdown item click to add/remove from pendingSelections
   - Updated chip remove handler to filter pendingSelections

2. Fix chips toolbar (search/delete all) not showing:
   - PHP renderer was pre-creating chips-wrapper without toolbar
   - JS ensureChipsWrapper was skipping because wrapper existed
   - Removed wrapper from PHP so JS creates complete wrapper with toolbar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 18:41:22 +00:00
parent 743e9c8020
commit 5ee4617cb1
5 changed files with 85 additions and 4 deletions

View File

@@ -1047,9 +1047,8 @@ class EntitySelectorRenderer
switch ($valueType) {
case 'entity_search':
$noItemsPlaceholder = $this->trans('No items selected - use search below');
$html .= '<div class="chips-wrapper">';
// Don't pre-wrap chips - JS will create the wrapper with toolbar when chips are added
$html .= '<div class="entity-chips ' . $chipsClass . '" data-placeholder="' . $this->escapeAttr($noItemsPlaceholder) . '"></div>';
$html .= '</div>';
$html .= '<div class="entity-search-box">';
$html .= '<i class="icon-search entity-search-icon"></i>';
$html .= '<input type="text" class="entity-search-input" placeholder="' . $this->trans('Search by name, reference, ID...') . '" autocomplete="off">';