diff --git a/field_select.go b/field_select.go index 2202ccae..87b84eaf 100644 --- a/field_select.go +++ b/field_select.go @@ -367,7 +367,6 @@ func (s *Select[T]) descriptionView() string { func (s *Select[T]) choicesView() string { var ( styles = s.activeStyles() - c = styles.SelectSelector.String() sb strings.Builder ) @@ -384,9 +383,9 @@ func (s *Select[T]) choicesView() string { for i, option := range s.filteredOptions { if s.selected == i { - sb.WriteString(c + styles.SelectedOption.Render(option.Key)) + sb.WriteString(styles.SelectSelector.String() + styles.SelectedOption.Render(option.Key)) } else { - sb.WriteString(strings.Repeat(" ", lipgloss.Width(c)) + styles.Option.Render(option.Key)) + sb.WriteString(styles.UnselectSelector.String() + styles.Option.Render(option.Key)) } if i < len(s.options)-1 { sb.WriteString("\n") diff --git a/theme.go b/theme.go index 32982a1b..8c714c98 100644 --- a/theme.go +++ b/theme.go @@ -26,10 +26,11 @@ type FieldStyles struct { ErrorMessage lipgloss.Style // Select styles. - SelectSelector lipgloss.Style // Selection indicator - Option lipgloss.Style // Select options - NextIndicator lipgloss.Style - PrevIndicator lipgloss.Style + SelectSelector lipgloss.Style // Selection indicator + UnselectSelector lipgloss.Style + Option lipgloss.Style // Select options + NextIndicator lipgloss.Style + PrevIndicator lipgloss.Style // FilePicker styles. Directory lipgloss.Style @@ -86,6 +87,7 @@ func ThemeBase() *Theme { t.Focused.ErrorIndicator = lipgloss.NewStyle().SetString(" *") t.Focused.ErrorMessage = lipgloss.NewStyle().SetString(" *") t.Focused.SelectSelector = lipgloss.NewStyle().SetString("> ") + t.Focused.UnselectSelector = lipgloss.NewStyle().SetString(" ") t.Focused.NextIndicator = lipgloss.NewStyle().MarginLeft(1).SetString("→") t.Focused.PrevIndicator = lipgloss.NewStyle().MarginRight(1).SetString("←") t.Focused.MultiSelectSelector = lipgloss.NewStyle().SetString("> ")