Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'enum_filter' not working for 'multiselect' control #510

Closed
caritaou opened this issue Feb 25, 2021 · 1 comment
Closed

'enum_filter' not working for 'multiselect' control #510

caritaou opened this issue Feb 25, 2021 · 1 comment

Comments

@caritaou
Copy link
Member

caritaou commented Feb 25, 2021

The UI does not update correctly when using an enum_filter condition on a multiselect control.
EnumFilterMultiselect.json.zip

1 multiselect - initial

2 multiselect - initial options

3 multiselect - set new options

4 multiselect - new options

5 multiselect - reset to initial options

From the above image, we can see that there are no selected options passed into the Multiselect control, but there are still items shown as selected:

6 multiselect - option shown selected even though it shouldnt be

enum_filter is a condition option inside common properties that allows a dropdown list to have its values changed/filtered based on the value of another control. For example in the image above, the default dropdown will show all the values (red, orange, yellow, green, blue, purple). If the user selects the checkbox, the dropdown values will then be filtered to show only a subset of the original list, say red, blue, green. This is currently working for a normal dropdown

The issue is with the Carbon Combobox where users have the ability to select multiple items from the dropdown. If there is an enum_filter applied to this Combobox, we are not able to filter the list of original values correctly for all the different scenarios.

  • if there were any preselected values before filter, the new filtered list should remove that selection - this does not work with Combobox
  • if there is a default value tied to this dropdown, we need to display that as automatically selected - this does not work with Combobox
  • if user makes any new selection in the filtered list and then the filter is removed, the number in the Combox does not get updated

There might be a few other cases that I dont recall with this not working, and its because of Combobox not allowing us to specify selected items, or clear selected items programmatically

@matthoward366
Copy link
Member

A "fix" has been added for this. carbon doesn't fully support this but a workaround was added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants