I am running the code below in a custom experience builder widget. It is supposed to filter multiple layers in the map. The filter works as expected but as soon as I click on a feature in the map and the pop up opens, the filter is cleared from all the layers. I expect the filter to be maintained on the layers until I remove it on the click of another button. What could be causing this behaviour?
import { React, type SqlQueryParams, type AllWidgetProps, DataSourceManager, type FeatureLayerDataSource } from 'jimu-core'
import { JimuMapViewComponent, type JimuMapView } from 'jimu-arcgis'
import FeatureLayer from 'esri/layers/FeatureLayer'
import { Select, Option } from 'jimu-ui'
import { FeatureLayerDataSourceImpl } from 'jimu-core/data-source'
import { FeatureLayerDataSourceManager } from 'dist/widgets/common/chart/src/runtime/chart/data-source'
const { useState } = React //{} allow destructuring of this constant
const Widget = (props: AllWidgetProps<any>) => {
const [jmv, setJmv] = useState<JimuMapView>()
const activeViewChangeHandler = (jimumapview: JimuMapView) => {
if (jimumapview) {
setJmv(jimumapview)
}
}
const addLayerHandler = (evt) => {
evt.preventDefault()