Skip to content

fix(ui): error after clearing selected collection in ListDrawer when multiple collections are available #12276

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

swheeler7
Copy link
Contributor

What?

The ListDrawer renders a list view for one or many collections. In the case where the drawer is rendering the list view for many collections (such as in the case of polymorphic relations) it is possible to clear the selected relationship from the select component in the ui, which throws an error as the renderList function expects a slug.

How?

This fix sets isClearable to 'false' in the ReactSelect component so that there is always a value passed in to the renderList function. I suppose an alternative would be to add logic to handle a null value being passed in to the renderList function, but I can't think of a case when we would ever not want to render a list in the ListDrawer so I think simply setting isClearable to 'false' should be enough.

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

Successfully merging this pull request may close these issues.

1 participant