Skip to main content

select_trigger

Function select_trigger 

Source
pub fn select_trigger(
    key: impl Into<String>,
    current_label: impl Into<String>,
) -> El
Expand description

The trigger surface for a select. Visually a button-shaped row of [ current_label ▼ ] keyed by key. Click emits Click on key; the app toggles its open flag in on_event.

Default height is tokens::CONTROL_HEIGHT — use that constant when sizing a parent row that has to fit the trigger.

The trigger is also the anchor key for select_menu — keep them identical so the menu drops below the trigger.

Examples found in repository?
examples/settings_calibration.rs (line 225)
224fn setting_select(label: &'static str, value: &'static str, key: &'static str) -> El {
225    form_item([form_label(label), form_control(select_trigger(key, value))]).width(Size::Fill(1.0))
226}