appbaseio / appbaseio/reactivesearch

MultiList can't use customQuery with empty defaultValue

Open
#1,402 5 comments 0 reactions 1 assignee Claimed by @ShahAnuj2610 View on GitHub
bug
Dominant language
JavaScript
Stars
4.9k
Forks
478
PR merge metrics
No merged PRs in 30d

Description

**Affected Projects**
React

**Library Version:** x.y.z
```
"@appbaseio/reactivecore": "^9.0.3",
"@appbaseio/reactivesearch": "^3.2.4",
```

**Describe the bug**
`MultiList` with a `customQuery` never calls custom query when default value is an empty array.

**To Reproduce**
```jsx
{
if (value.length) {
return { query: { terms: { [props.dataField]: value } } };
}

return { query: { bool: must_not: { term: { [props.dataField]: 'comment' } } };
}}
/>
```

Steps to reproduce the behavior:

**Expected behavior**
Default query excludes type = comment documents.

**Additional context**
This is caused by the MultiList component constructor not calling setValue and thus not calling updateQuery when the default value is empty.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.