Patternfly-react: SelectOptionObject does not show checked items for Select component

Created on 10 Mar 2020  路  4Comments  路  Source: patternfly/patternfly-react

Currently the SelectOptionObject does not show the checked items when used with a checked variant of Select. A work around for now is to map the select object to strings which will allow it to be displayed as checked with in the Select check variant.

The code here:

https://github.com/patternfly/patternfly-react/blob/4abb5b6e766ff1c669423dcb7cafc29fe4b02464/packages/react-core/src/components/Select/SelectMenu.tsx#L106

and here:

https://github.com/patternfly/patternfly-react/blob/4abb5b6e766ff1c669423dcb7cafc29fe4b02464/packages/react-core/src/components/Select/SelectMenu.tsx#L119

Should be updated to support SelectOptionObjects.

PF4 bug

All 4 comments

Closing issue after looking at code.

I have a dev still coming up against this issue. If there is a work around, can it be documented somewhere?

@nicolethoen The workaround is to use strings for value, mentioned at the top. For customized display, the children property of SelectOption may be used instead of SelectOptionObject's toString function.

The SelectOptionObject now displays the checked items, but shows the wrong total checked items.

See https://github.com/patternfly/patternfly-react/issues/4478

Was this page helpful?
0 / 5 - 0 ratings