Browse Source

Fix material current item reset

CURA-6679
Lipu Fei 5 years ago
parent
commit
2ce567ccfe

+ 1 - 0
resources/qml/Preferences/Materials/MaterialsList.qml

@@ -102,6 +102,7 @@ Item
                 }
             }
         }
+        base.currentItem = null
         return false
     }
 

+ 5 - 0
resources/qml/Preferences/Materials/MaterialsPage.qml

@@ -58,6 +58,11 @@ Item
     {
         forceActiveFocus()
         materialDetailsPanel.currentItem = currentItem
+        // CURA-6679 If the current item is gone after the model update, reset the current item to the active material.
+        if (currentItem == null)
+        {
+            resetExpandedActiveMaterial()
+        }
     }
 
     // Main layout