Skip to content
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

Remove unwanted props from Select component #5277

Merged
merged 4 commits into from Nov 22, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/app/components/QueryBasedParameterInput.jsx
Expand Up @@ -77,7 +77,7 @@ export default class QueryBasedParameterInput extends React.Component {
}

render() {
const { className, value, mode, onSelect, ...otherProps } = this.props;
const { className, mode, onSelect, optionFilterProp, queryId, ...otherProps } = this.props;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, removing the value from here will cause it to be replaced from otherProps, which is causing Cypress to fail

const { loading, options } = this.state;
return (
<span>
Expand All @@ -89,7 +89,7 @@ export default class QueryBasedParameterInput extends React.Component {
value={this.state.value}
onChange={onSelect}
options={map(options, ({ value, name }) => ({ label: String(name), value }))}
optionFilterProp="children"
optionFilterProp={optionFilterProp || "children"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the optionFilterProp change instead of leaving it to be replaced from otherProps? If you are using it, it shouldn't be an "unwanted" prop 😅

showSearch
showArrow
notFoundContent={isEmpty(options) ? "No options available" : null}
Expand Down