Skip to content

Commit

Permalink
BUGFIX: Prevent rendering of SearchBox
Browse files Browse the repository at this point in the history
When the displaySearchBox property is false, we should not render the SelectBox that is responsible for the search.

Fixes: #3673
  • Loading branch information
markusguenther committed Dec 18, 2023
1 parent f5c3c50 commit c229a79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,5 @@ exports[`<MultiSelectBox/> should render correctly. 1`] = `
values={Array []}
/>
</ul>
<Component
IconButtonComponent={[Function]}
IconComponent={[Function]}
ListPreviewElement={[Function]}
MultiSelectBox_ListPreviewSortable={[Function]}
SelectBox={[Function]}
allowEmpty={true}
dndType="multiselect-box-value"
onCreateNew={[MockFunction]}
onValueChange={[Function]}
onValuesChange={[MockFunction]}
optionValueField="value"
options={Array []}
value=""
values={Array []}
/>
</div>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ class MultiSelectBox extends PureComponent {
render() {
const {
searchOptions,
displaySearchBox,
values,
optionValueField,
theme,
Expand Down Expand Up @@ -217,13 +218,13 @@ class MultiSelectBox extends PureComponent {
disabled={disabled}
/>
</ul>
<SelectBox
{displaySearchBox && (<SelectBox
{...omit(this.props, ['theme', 'className'])}
options={filteredSearchOptions}
value=""
onValueChange={this.handleNewValueSelected}
disabled={disabled}
/>
/>)}
</div>
);
}
Expand Down

0 comments on commit c229a79

Please sign in to comment.