#105756When opening an item using treeSelect the selected parent node is not visible initially
Description
The problem currently is when the selectTree is opened and one is already selected it is not visible which is selected. This is not so intuitive for untrained editors and may confuse editors not using this regularly.
If compared with the other field type selectSingle or selectMultipleSideBySide, there it is immediately visible which options are selected.
This may happen if there are lots of items or expandAll is set to false.
I use a custom extension with treeSelect. The following is set:
$GLOBALS['TCA']['sys_category']['columns']['parent']['config']['treeConfig']['appearance']['expandAll'] = false;
This can also be reproduced with sys_category.
Main goal
Immediately be able to see if any option is selected on opening an element with selectTree. Ideally also be able to see which are selected (if it is only 1 or a small number).
Currently, it is necessary to click on the “Toggle hide unchecked”
Possible solutions
1. Always open selectTree as if “Toggle hide unchecked” was already clicked (I don’t know if this is always the best idea)
2. Additionally show the number of selected elements and which elements are selected (for small numbers)
Details for solution no 2:
I modified this locally so I now see the additional information:
- the number of selected entries is displayed
- if the number of selected entries is below a certain number (3 currently), the selected entries are diplayed, e.g.
selectTree-show-selected.png
Examples / screenshots
Example with expandAll= false and custom extension.
This is what I see on opening my form initially:
selectTree_open_initial.png
This is what I would see (with solution 1):
selectTree_open_initial_selected.png
This is what I see when this button is clicked:
selectTree_buttons.png
Example with sys_category in v14: The selected item is not visible because scrolled away:
selectTree_open_selected.gif
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.