Skip to content

Commit

Permalink
Merge pull request #463 from saddlebackdev/feature/bug_fix_in_action_…
Browse files Browse the repository at this point in the history
…bar_search

[dev] [No Bug/PBI] Fix improper console warning in `<ActionBarSearch>`
  • Loading branch information
groberts314 authored Sep 26, 2023
2 parents 9e8f02d + ffac32c commit 8e60f42
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/surfaces/actionBar/actionBarSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,14 @@ class ActionBarSearch extends React.PureComponent {
value,
} = this.props;

const hasCorrectDataForSearchWithSelect = !isNil(searchWithSelect) &&
isArray(searchWithSelect.options) &&
isFunction(searchWithSelect.onChange) &&
('value' in searchWithSelect);
const isUsingSearchWithSelect = !isNil(searchWithSelect);

if (!hasCorrectDataForSearchWithSelect) {
const hasCorrectDataForSearchWithSelect = isUsingSearchWithSelect &&
isArray(searchWithSelect.options) &&
isFunction(searchWithSelect.onChange) &&
('value' in searchWithSelect);

if (isUsingSearchWithSelect && !hasCorrectDataForSearchWithSelect) {
console.warn( // eslint-disable-line no-console
'Please provide correct props to integrate Select with action bar search. See documentation of react-cm-ui for more details.',
);
Expand Down

0 comments on commit 8e60f42

Please sign in to comment.