pub struct Autocomplete { /* private fields */ }Expand description
A text field with a live-filtered suggestion dropdown below it.
Implementations§
Source§impl Autocomplete
impl Autocomplete
Sourcepub fn new(options: Vec<impl Into<String>>, open: Atom<bool>) -> Self
pub fn new(options: Vec<impl Into<String>>, open: Atom<bool>) -> Self
options is the full candidate list to filter against; open is an
initially-false atom this widget manages as the user types.
pub fn value(self, v: impl Into<String>) -> Self
pub fn placeholder(self, p: impl Into<String>) -> Self
pub fn width(self, w: f32) -> Self
pub fn height(self, h: f32) -> Self
Sourcepub fn max_visible(self, n: usize) -> Self
pub fn max_visible(self, n: usize) -> Self
Cap on how many matches show at once (default 6).
Trait Implementations§
Source§impl Widget for Autocomplete
impl Widget for Autocomplete
Source§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for Autocomplete
impl !UnwindSafe for Autocomplete
impl Freeze for Autocomplete
impl Send for Autocomplete
impl Sync for Autocomplete
impl Unpin for Autocomplete
impl UnsafeUnpin for Autocomplete
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
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.