Skip to content

Commit 26361d7

Browse files
committed
feat: add get selected for check box
1 parent 94b81c5 commit 26361d7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/checkbox.go

+10
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,13 @@ func (s *CheckBox[T]) View() string {
6565
}
6666
return b.String()
6767
}
68+
69+
func (s *CheckBox[T]) GetSelected() []T {
70+
selected := make([]T, 0)
71+
for idx, isSelected := range s.Selected {
72+
if isSelected {
73+
selected = append(selected, s.Options[idx])
74+
}
75+
}
76+
return selected
77+
}

0 commit comments

Comments
 (0)