I have observed a potential bug on the nuxeo-select component.
Here is the behavior:
In a screen that contains 2 nuxeo-selects, the options of the first nuxeo-select are a list of fixed values.
The options of the second nuxeo-select are initialized based on the value of the first nuxeo-select.
The first time a value is selected in the first nuxeo-select, the options of the second nuxeo-select are retrieved using a Nuxeo operation and are stored in an array that serves as a cache.
If a value that has already been selected previously in the first nuxeo-select is selected, the values of the cache array are used to populate the options of the second nuxeo-select.
Overall, the system works well, when I choose a value in the first nuxeo-select, the options of the second are initialized accordingly and the first option is selected in the widget.
The problematic behavior occurs when you select twice in a row in the first nuxeo-select an option for which the list of options of the second nuxeo-select contains a single value:
1. Choose a value in the first nuxeo-select that implies a unique option in the second
2. choose another value in the first nuxeo-select that also implies a unique option in the second
=> the second nuxeo select displays the placeholder instead of the first (and unique) option.
=> the first (and unique) option is well assigned to the "selected" attribute of the second nuxeo-select, only the display is problematic.
=> if we unfold the second nuxeo-select, we can see the value but it doesn't change anything to click on it (probably because technically it is already selected)
Additional informations:
- this behavior occurs systematically, whether the options are already in the cache array or not
- all options are displayed correctly if there were at least 2 options in the previous values
- there are no cases where the options are empty in my use case
Here is an example scenario
The values of the options are:
- TeamB (Nuxeo)
- Nuxeo Support B
- Billy's Team (Billy's Account)
- Demo Project
- Nuxeo Addon
- TeamA (Nuxeo)
- Nuxeo Support A
- Demo (Nuxeo)
- Nuxeo Demo
- Nuxeo Dev (Nuxeo)
- Demo Project
- Dev
- NHartman Test Edit
- OCDM (OCDM)
- Nuxeo connector
- OCDM project 2
1. selection of "Billy's Team" (2 sub-options) in the 1st nuxeo-select
=> 2nd nuxeo-select displays "Demo Project" : [OK]
2. selection of "TeamA" (1 sub-option) in the 1st nuxeo-select
=> 2nd nuxeo-select displays "Nuxeo Support A" : [OK]
3. selection of "Demo" (1 sub-option) in the 1st nuxeo-select
=> 2nd nuxeo-select displays the placeholder : [KO !]
3. selection of "OCDM" (3 sub-options) in the 1st nuxeo-select
=> 2nd nuxeo-select displays "Nuxeo connector" : [OK]
4. re-selection of "Demo" (1 sub-option) in the 1st nuxeo-select
=> 2nd nuxeo-select displays "Nuxeo Demo" : [OK]
5. re-selection of "TeamA" (1 sub-option) in the 1st nuxeo-select
=> 2nd nuxeo-select displays the placeholder : [KO !]
Example of concerned code:
The nuxeo-select
The code that updates the options of the second nuxeo-select based on the value of the first
I use nuxeo-elements and nuxeo-ui-elements in version 3.1.x