Expand description
day-piece-combobox — an EXTERNAL Day Piece (DESIGN.md §15 tier 1, Appendix B.1): one Rust API, per-toolkit native renderers registered link-time into each backend’s slice, with no edits to Day or its toolkit crates. The Qt and XAML renderers carry their own C++ shims; the Android renderer its own Java factory.
A REAL combo box: free-form text entry PLUS a dropdown of suggestions, as the platform’s
genuine combo control — NSComboBox (AppKit), GtkComboBoxText with an entry (GTK), an
editable QComboBox (Qt), AutoCompleteTextView (Android), an editable ComboBox (XAML).
Because a typed value need not be in the list, the VALUE is the text: a Signal<String>
bound two-way, exactly like search_field (typing sets the signal; setting the signal
patches the control, echo-guarded). Picking a dropdown item is just another way to set the
text — every backend reports it through the same Event::TextChanged. The suggestion list
is reactive: items is a Signal<Vec<String>> and changes patch the native list live.
iOS has no native combo-box control, so this piece deliberately carries no uikit renderer — day renders its placeholder leaf there (docs/combobox.md).
let flavor = Signal::new(String::new());
combo_box(flavors, flavor).placeholder("Type or choose…")Structs§
- Combo
Box - A native combo box bound two-way to
text, with a reactive dropdown ofitems. - Combo
Props - Full props (realize).
itemsseeds the dropdown,textthe entry;placeholderis the empty-state prompt (fixed at build). After build,itemsandtextchange viaComboPatch.
Enums§
- Combo
Patch - Sparse imperative updates: replace the dropdown’s items, or the entry’s text (programmatic sync from the bound signal). An items swap must keep the typed text — the text is the value.
Constants§
Functions§
- combo_
box combo_box(items, text)— free-form text entry plus a native dropdown of suggestions. Typing (or picking an item) writestext; setting either signal patches the control.