Documentation
¶
Overview ¶
Package autocomplete provides a small searchable single-line selection control.
Index ¶
- type KeyMap
- type Model
- func (m *Model) Blur()
- func (m *Model) Focus() tea.Cmd
- func (m Model) InputView() string
- func (m Model) Open() bool
- func (m Model) Query() string
- func (m *Model) Search()
- func (m *Model) SetGeometry(width, height int)
- func (m *Model) SetStyles(styles textinput.Styles)
- func (m *Model) SetValue(value string) bool
- func (m *Model) Update(msg tea.Msg) (cmd tea.Cmd, handled bool)
- func (m Model) Value() string
- func (m *Model) View() bounded.ListView
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMap ¶
KeyMap supplies the active surface's bindings. Tab is deliberately not an autocomplete action: callers retain it for focus navigation.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model combines a Bubbles text input with a bounded match list. It owns query, selection, acceptance, and geometry; callers own options and presentation.
func (*Model) Blur ¶
func (m *Model) Blur()
Blur hides suggestions without changing the query or accepted value.
func (*Model) Search ¶
func (m *Model) Search()
Search starts a fresh query without discarding an accepted selection. Typing replaces that selection; an untouched empty search still retains its value.
func (*Model) SetGeometry ¶
SetGeometry configures the visible match-list area. Invalid geometry suppresses input and actions until a later usable offer, preserving the draft unchanged.
func (*Model) SetValue ¶
SetValue selects an option by stable value. It returns false for an unknown value.
func (*Model) Update ¶
Update routes input, cursor, paste, and active action messages. handled is false for unclaimed keys such as Tab so the enclosing form can route them normally.