Expand description
Combobox — a select you can type into: the closed face of a select over
an anchored menu whose rows narrow as you search.
An entity for the same reason crate::palette::CommandPalette is one — it
owns a query TextField. The two share popover::Filter and differ only
in frame: the palette is a modal over every command, this hangs under a
trigger and remembers what was chosen.
ⓘ
ui::combobox::init(cx); // once, at startup (with input::init)
let language = cx.new(|cx| Combobox::new(vec!["Rust".into()], "Language", cx));
cx.subscribe(&language, |_, _, event, _| match event {
ComboboxEvent::Selected(index) => { /* item `index` */ }
})
.detach();Re-exports§
pub use input::KEY_CONTEXT as FIELD_KEY_CONTEXT;
Structs§
Enums§
- Combobox
Event - What the combobox reports. The index is into the ORIGINAL item list, never into the filtered view.
Constants§
- KEY_
CONTEXT - The key context the combobox claims. It wraps the query field’s own context, so typing goes to the field while navigation keys fall through.
Functions§
- init
- Install the combobox’s navigation bindings. Call once, alongside
crate::input::init.