reubenlillie
**Describe the bug** Relation filters don’t appear to understand multiple values. If a related collection has a `select` field with `multiple: true`: ```yaml - name: pets widget: select multiple: true options: - label: Cats value: cats - label: Dogs value: dogs - label: Birds value: birds ``` and a `relation` filters that field: ```yaml filters: - field: pets values: - cats - dogs ``` an entry with `pets: [cats, birds]` isn't matched. **To Reproduce** 1. Create a collection with a `multiple: true` select field 2. Create an entry with more than one selected value 3. Create a relation to that collection 4. Add a filter for one or more of the possible values 5. Note that entries containing those values aren't returned **Expected behavior** If a field contains multiple values, the relation filter should match when any of those values is included in the filter's `values`. For example: ```text entry: [cats, birds] filter: [cats, dogs] ``` should match because `cats` is present in both. Scalar fields should continue to behave exactly as they do now. **Screenshots** Not applicable. **Applicable Versions:** * Decap CMS version: 3.16.3 (unpkg) * Git provider: GitHub * OS: Arch * Browser version: Chrome Version 151.0.7922.71 (Official Build) (x86_64) * Node.JS version: 26.8.1 **CMS configuration** Relevant configuration only: ```yaml - name: pets widget: select multiple: true options: - label: Cats value: cats - label: Dogs value: dogs - label: Birds value: birds # ...etc. - name: human widget: relation collection: example filters: - field: pets values: - cats - dogs ``` **Additional context** In [`RelationControl.js`](https://github.com/decaporg/decap-cms/blob/1d5868347d3d8648d7d5f7f59fc1b46595881b29/packages/decap-cms-widget-relation/src/RelationControl.js), `parseHitOptions` currently evaluates the filter with: ```js filter.values.includes(value) ``` This works when `value` is scalar, but not when the filtered field contains multiple values. It seems like a small case of the filter asking, “Is this whole array one of these values?” when it really wants to ask, “Does this array contain one of these values?” Something like this would be backwards compatible: ```js Array.isArray(value) ? value.some(item => filter.values.includes(item)) : filter.values.includes(value) ```