Hello,
I made a custom widget to simplify the filtering process, it applies the filter just fine (for example, filtering by state will filter out all but the selected states in a drop down menu) but the moment I click any of the feature polygons in the map to see the attributes of that feature, the filter disappears and I can see all the states again.
Here are the relevant parts of my code:
// Apply filter function from BlocksBeadFilter.tsx
const addFilter = (): void => {
if (!layerInfo) return
const lyr = layerInfo.lyr
// Build age clause
const ageClause = (() => {
if (!ageSelected.length || ageMin.value <= 0) return ''
const flds = ageSelected.flatMap(l => ageMap[l] || [])
return flds.length ? `(${flds.map(f => `${f} > ${ageMin.value}`).join(' OR ')})` : ''
})()
// Build all clauses
const clauses = [
buildInClause('ProviderName', provider.selected),
buildInClause('StateName', state.selected),
buildInClause('CountyName', county.selected),