fix issue with checkbox state of select based search key

This commit is contained in:
John Mitchell
2020-01-09 15:40:57 -05:00
parent 1e344bdf8a
commit 4a9979e2db

View File

@@ -221,6 +221,11 @@ class Search extends React.Component {
showToolbarItem={searchKey === key} showToolbarItem={searchKey === key}
> >
{(options && ( {(options && (
<Fragment>
{/* TODO: update value to being object
{ actualValue: optionKey, toString: () => label }
currently a pf bug that makes the checked logic
not work with object-based values */}
<Select <Select
variant={SelectVariant.checkbox} variant={SelectVariant.checkbox}
aria-label={name} aria-label={name}
@@ -233,15 +238,10 @@ class Search extends React.Component {
placeholderText={`Filter by ${name.toLowerCase()}`} placeholderText={`Filter by ${name.toLowerCase()}`}
> >
{options.map(([optionKey]) => ( {options.map(([optionKey]) => (
<Fragment key={optionKey}>
{/* TODO: update value to being object
{ actualValue: optionKey, toString: () => label }
currently a pf bug that makes the checked logic
not work with object-based values */}
<SelectOption key={optionKey} value={optionKey} /> <SelectOption key={optionKey} value={optionKey} />
</Fragment>
))} ))}
</Select> </Select>
</Fragment>
)) || )) ||
(isBoolean && ( (isBoolean && (
<Select <Select