This is an automated email from the ASF dual-hosted git repository.

villebro pushed a commit to branch 1.3
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4c6a2597b4954cd4f57deed02160621075c5f7e5
Author: Kamil Gabryjelski <[email protected]>
AuthorDate: Wed Aug 11 14:05:44 2021 +0200

    fix(explore): metric label disappearing in some scenarios (#16190)
    
    (cherry picked from commit 98fc29cbbbdc1d94a61d9f1a12984e409568cc43)
---
 .../components/controls/DndColumnSelectControl/DndMetricSelect.tsx     | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
 
b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
index 6fc8714..f44934a 100644
--- 
a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
+++ 
b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndMetricSelect.tsx
@@ -185,6 +185,9 @@ export const DndMetricSelect = (props: any) => {
 
   const onMetricEdit = useCallback(
     (changedMetric: Metric | AdhocMetric, oldMetric: Metric | AdhocMetric) => {
+      if (oldMetric instanceof AdhocMetric && oldMetric.equals(changedMetric)) 
{
+        return;
+      }
       const newValue = value.map(value => {
         if (
           // compare saved metrics

Reply via email to