File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
WooCommerce/Classes/ViewRelated/Products/ProductSelector Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ struct ProductVariationSelectorView: View {
1515
1616 private let onMultipleSelections : ( ( [ Int64 ] ) -> Void ) ?
1717
18+ @State private var hasSentSelectionOnDismiss = false
19+
1820 /// Tracks the state for the 'Clear Selection' button
1921 ///
2022 private var isClearSelectionDisabled : Bool {
@@ -101,6 +103,11 @@ struct ProductVariationSelectorView: View {
101103 . accessibilityLabel ( Localization . backButtonAccessibilityLabel)
102104 }
103105 }
106+ . onDisappear {
107+ guard !hasSentSelectionOnDismiss else { return }
108+ hasSentSelectionOnDismiss = true
109+ onMultipleSelections ? ( viewModel. selectedProductVariationIDs)
110+ }
104111 . onAppear {
105112 viewModel. onLoadTrigger. send ( )
106113 }
You can’t perform that action at this time.
0 commit comments