pub trait TextFieldBuilder: Sized {
// Required methods
fn enabled<M>(self, v: impl IntoReactive<bool, M>) -> Self;
fn placeholder<M>(self, t: impl IntoText<M>) -> Self;
fn on_submit(self, f: impl Fn() + 'static) -> Self;
fn secure<M>(self, v: impl IntoReactive<bool, M>) -> Self;
fn read_only<M>(self, v: impl IntoReactive<bool, M>) -> Self;
fn input_purpose(self, purpose: InputPurpose) -> Self;
fn submit_label(self, label: SubmitLabel) -> Self;
fn max_length(self, characters: u32) -> Self;
}Expand description
Required Methods§
Sourcefn enabled<M>(self, v: impl IntoReactive<bool, M>) -> Self
fn enabled<M>(self, v: impl IntoReactive<bool, M>) -> Self
Whether the field takes input (default true); a constant or a reactive bool. A
disabled field neither edits nor focuses; TextField::read_only keeps it selectable.
fn placeholder<M>(self, t: impl IntoText<M>) -> Self
Sourcefn on_submit(self, f: impl Fn() + 'static) -> Self
fn on_submit(self, f: impl Fn() + 'static) -> Self
Fire when the user submits the field (Return / the keyboard’s action key). Field
chaining is a focus write inside the handler: focus.set(Some(Field::Next))
(docs/focus.md).
Sourcefn secure<M>(self, v: impl IntoReactive<bool, M>) -> Self
fn secure<M>(self, v: impl IntoReactive<bool, M>) -> Self
Hide the characters as they are typed (default false). Reactive: bind it to a signal
for a show-password switch. The text, the placeholder and the focus carry across the
change on every backend, including the two whose secure field is a different native
class.
Sourcefn read_only<M>(self, v: impl IntoReactive<bool, M>) -> Self
fn read_only<M>(self, v: impl IntoReactive<bool, M>) -> Self
Show the text and let it be selected and copied, and take no edits (default false).
Reactive. Unlike .disabled(true) the field keeps its ordinary look and still takes
focus.
Sourcefn input_purpose(self, purpose: InputPurpose) -> Self
fn input_purpose(self, purpose: InputPurpose) -> Self
What the field collects: the on-screen keyboard, capitalization and correction, and what the system offers to fill in all follow from it.
Sourcefn submit_label(self, label: SubmitLabel) -> Self
fn submit_label(self, label: SubmitLabel) -> Self
What the on-screen keyboard’s action key says. The key fires on_submit either way.
Sourcefn max_length(self, characters: u32) -> Self
fn max_length(self, characters: u32) -> Self
The most characters the field takes. Typing or pasting past it is cut to fit before the bound value sees it.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".