Skip to content

Commit 12a297a

Browse files
committed
fix: checkbox order
1 parent ab016da commit 12a297a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/checkbox.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ func (s *CheckBox[T]) View() string {
7171

7272
func (s *CheckBox[T]) GetSelected() []T {
7373
selected := make([]T, 0)
74-
for idx, isSelected := range s.Selected {
75-
if isSelected {
74+
for idx := range s.Options {
75+
if s.Selected[idx] {
7676
selected = append(selected, s.Options[idx])
7777
}
7878
}
@@ -81,8 +81,8 @@ func (s *CheckBox[T]) GetSelected() []T {
8181

8282
func (s *CheckBox[T]) GetSelectedString() string {
8383
var selected []string
84-
for idx, isSelected := range s.Selected {
85-
if isSelected {
84+
for idx := range s.Options {
85+
if s.Selected[idx] {
8686
selected = append(selected, fmt.Sprintf("%v", s.Options[idx]))
8787
}
8888
}

0 commit comments

Comments
 (0)