File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Projects/Feature/FeatureRecommend/Sources/Recommend Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ struct RecommendKeywordBottomSheet: View {
1616 private var selectedInterests : Set < BaseInterest >
1717 @State
1818 private var height : CGFloat = 0
19+ @State
20+ private var isTouchActive : Bool = false
1921
2022 private let interests : [ BaseInterest ]
2123 private let onSave : ( ( Set < BaseInterest > ) -> Void ) ?
@@ -113,15 +115,24 @@ extension RecommendKeywordBottomSheet {
113115 : isMaxCount ? . disable : . default( . primary) ,
114116 size: . medium
115117 ) {
118+ guard !isTouchActive else { return }
119+
116120 if isSelected {
117121 selectedInterests. remove ( field)
118122 } else {
119- selectedInterests. insert ( field)
123+ if selectedInterests. count < 3 {
124+ selectedInterests. insert ( field)
125+ }
120126 }
121127 }
122128 }
123129 . animation ( . pokitDissolve, value: selectedInterests)
124130 }
131+ . simultaneousGesture (
132+ DragGesture ( minimumDistance: 0 )
133+ . onChanged { _ in isTouchActive = true }
134+ . onEnded { _ in isTouchActive = false }
135+ )
125136 }
126137}
127138
You can’t perform that action at this time.
0 commit comments