Преглед изворни кода

Hide selection picker onAppear and onDisappear

Deniz Cengiz пре 1 година
родитељ
комит
2b1febb49c
1 измењених фајлова са 7 додато и 0 уклоњено
  1. 7 0
      Trio/Sources/Modules/Onboarding/View/TherapySettingEditorView.swift

+ 7 - 0
Trio/Sources/Modules/Onboarding/View/TherapySettingEditorView.swift

@@ -114,6 +114,13 @@ struct TherapySettingEditorView: View {
         .onAppear {
             // ensure picker is closed when view appears
             selectedItemID = nil
+            // sorts items
+            validateTherapySettingItems()
+        }
+        .onDisappear {
+            // ensure picker is closed when view appears
+            selectedItemID = nil
+            // sorts items
             validateTherapySettingItems()
         }
         .onChange(of: items, { _, _ in