Skip to main content

Module searchfield

Module searchfield 

Source
Expand description

Core search input with a toolkit-owned native renderer: NSSearchField, UISearchTextField, GtkSearchEntry, a Qt search field, Android search input, XAML AutoSuggestBox, or DOM search input.

It is bound two-way to a Signal<String>, the same pattern as the core picker: a native edit dispatches an Event::TextChanged back to Rust which sets the signal, and an external signal change patches the control with SearchPatch::SetText. A per-build echo guard remembers the last value that arrived from the native control so its own change is not written straight back (which some toolkits would re-emit → a feedback loop). Like the core text_field it is a width-growing leaf (grow_w = true, natural height): a search field fills its row.

ⓘ
let query = Signal::new(String::new());
search_field(query).placeholder(res::str::search_placeholder())

Structs§

SearchField
A native search field bound two-way to query. Set a prompt with .placeholder(_).
SearchProps
Full props (realize). text seeds the control; placeholder is the empty-state prompt. Only text changes after build (via SearchPatch::SetText); the placeholder is fixed at build.

Enums§

SearchPatch
The single imperative update: replace the control’s text (programmatic sync from the signal).

Constants§

KIND

Traits§

SearchFieldBuilder
Builder methods of SearchField, reachable through a Decorated (docs/api-style.md “Typed builders and erasure”): generic modifiers and typed ones chain in any order.

Functions§

search_field
search_field(query): a native search input whose text mirrors query in both directions; query is a Signal<String> or any other two-way binding (a day-model Field).
support
Whether the selected toolkit implements this control.