pub struct ComboBox {
pub text: Property<String>,
pub selected: Property<Option<usize>>,
pub options: Property<Vec<String>>,
pub new_item: Property<NewItem>,
pub background: Property<Color>,
pub stroke: Property<Stroke>,
pub style: Property<TextStyle>,
pub corner_radius: Property<f64>,
pub _filtered_options: LocalProperty<Vec<ListItemData>>,
pub _options_visible: Property<bool>,
pub _selected_listener: LocalProperty<bool>,
}Expand description
A text-filtered list control for selecting one item, with optional “new item” behavior.
Clicking or tapping the input opens the list. Filtering is case-sensitive,
with prefix matches first and alphabetical order within each group. Selecting
a row commits its index in options, copies its label to text, and closes
the list. Editing or blurring the input does not commit a selection or clear
the previous one. Bind text for the query and selected for the last choice.
This composed control uses a native Textbox and Pax list rows. It does not implement arrow-key/Enter list selection or a complete accessible combobox contract.
Fields§
§text: Property<String>Text currently shown in the input.
selected: Property<Option<usize>>Index of the last selected option, or None. Editing text filters the
list; clicking a row commits its original index in options.
options: Property<Vec<String>>Available option labels; duplicate labels retain distinct indices.
Changing this list refreshes the selected label at the existing index.
An out-of-range selection becomes None and clears the text. Reordering
options does not preserve an application’s item identity automatically.
new_item: Property<NewItem>Behavior when the typed text does not match any option.
background: Property<Color>Textbox/list background color.
stroke: Property<Stroke>Textbox/list stroke.
style: Property<TextStyle>Text style for the textbox and list items.
corner_radius: Property<f64>Textbox corner radius, in pixels.
_filtered_options: LocalProperty<Vec<ListItemData>>§_options_visible: Property<bool>§_selected_listener: LocalProperty<bool>Implementations§
Source§impl ComboBox
impl ComboBox
pub fn on_mount(&mut self, ctx: &NodeContext)
pub fn on_click(&mut self, ctx: &NodeContext, _event: Event<Click>)
pub fn remove_index(&mut self, ctx: &NodeContext, event: Event<Click>)
pub fn update(&mut self, ctx: &NodeContext)
pub fn dispatch_new_item(&mut self, ctx: &NodeContext)
Trait Implementations§
Source§impl CoercionRules for ComboBox
impl CoercionRules for ComboBox
Source§fn is_identity_roundtrip() -> bool
fn is_identity_roundtrip() -> bool
Self preserves the semantics of converting that clone
through ToPaxValue and back with try_coerce. Read moreSource§fn try_coerce(value: PaxValue) -> Result<ComboBox, String>
fn try_coerce(value: PaxValue) -> Result<ComboBox, String>
value into Self.Source§fn allows_singleton_stack() -> bool
fn allows_singleton_stack() -> bool
Source§impl<'de> Deserialize<'de> for ComboBox
impl<'de> Deserialize<'de> for ComboBox
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComboBox, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComboBox, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl HelperFunctions for ComboBox
impl HelperFunctions for ComboBox
Source§fn register_all_functions()
fn register_all_functions()
impl ImplToFromPaxAny for ComboBox
Source§impl Interpolatable for ComboBox
impl Interpolatable for ComboBox
Source§fn interpolate(&self, _other: &Self, _t: f64) -> Self
fn interpolate(&self, _other: &Self, _t: f64) -> Self
Source§impl Serialize for ComboBox
impl Serialize for ComboBox
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl ToPaxValue for ComboBox
impl ToPaxValue for ComboBox
Source§fn to_pax_value(self) -> PaxValue
fn to_pax_value(self) -> PaxValue
PaxValue.Source§fn nested_properties(&self) -> Vec<UntypedProperty>
fn nested_properties(&self) -> Vec<UntypedProperty>
Source§fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
fn to_pax_value_in_graph(self) -> PaxValuewhere
Self: Sized,
Self::to_pax_value reads published value snapshots.Auto Trait Implementations§
impl !Send for ComboBox
impl !Sync for ComboBox
impl Freeze for ComboBox
impl RefUnwindSafe for ComboBox
impl Unpin for ComboBox
impl UnsafeUnpin for ComboBox
impl UnwindSafe for ComboBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> PropertyValue for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
Source§fn round_into(self) -> U
fn round_into(self) -> U
Source§impl<T> ToFromPaxAny for Twhere
T: ImplToFromPaxAny,
impl<T> ToFromPaxAny for Twhere
T: ImplToFromPaxAny,
Source§fn to_pax_any(self) -> PaxAny
fn to_pax_any(self) -> PaxAny
PaxAny.Source§fn from_pax_any(pax_any: PaxAny) -> Result<T, String>
fn from_pax_any(pax_any: PaxAny) -> Result<T, String>
PaxAny.