diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx index aaed450aa..07e081fc0 100644 --- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx +++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx @@ -41,6 +41,7 @@ export default observer(WidgetFormNew); const FilterSection = observer(({ metric, excludeFilterKeys }: any) => { const defaultClosed = React.useRef(metric.exists()) + const defaultSeries = React.useRef(metric.series.map(s => s.name)) const isTable = metric.metricType === TABLE; const isHeatMap = metric.metricType === HEATMAP; const isFunnel = metric.metricType === FUNNEL; @@ -75,7 +76,7 @@ const FilterSection = observer(({ metric, excludeFilterKeys }: any) => { series={series} onRemoveSeries={() => metric.removeSeries(index)} canDelete={metric.series.length > 1} - defaultClosed={defaultClosed.current} + defaultClosed={metric.hasChanged ? defaultSeries.current.includes(series.name) : defaultClosed.current} emptyMessage={ isTable ? 'Filter data using any event or attribute. Use Add Step button below to do so.' diff --git a/frontend/app/mstore/types/widget.ts b/frontend/app/mstore/types/widget.ts index e77d9cbf5..6a2cf667f 100644 --- a/frontend/app/mstore/types/widget.ts +++ b/frontend/app/mstore/types/widget.ts @@ -131,6 +131,7 @@ export default class Widget { } addSeries() { + this.hasChanged = true; const series = new FilterSeries(); series.name = 'Series ' + (this.series.length + 1); this.series.push(series);