pub struct InputState { /* private fields */ }Expand description
Editable state of a single-line text input.
Implementations§
Source§impl InputState
impl InputState
Sourcepub fn with_value(cx: &mut App, value: impl Into<String>) -> Self
pub fn with_value(cx: &mut App, value: impl Into<String>) -> Self
defaultValue — a state seeded with initial text, with the caret at the
end.
This is the uncontrolled entry point: React needs a defaultValue prop
because it has no state object to seed.
Sourcepub fn name(&self) -> Option<SharedString>
pub fn name(&self) -> Option<SharedString>
The name this field submits under, if one was set.
Sourcepub fn set_name(&mut self, name: Option<SharedString>)
pub fn set_name(&mut self, name: Option<SharedString>)
Sets the submission name. Called by the component’s name builder, not
usually by hand.
Sourcepub fn validation_behavior(&self) -> ValidationBehavior
pub fn validation_behavior(&self) -> ValidationBehavior
Whether this field’s invalidity blocks form submission.
Sourcepub fn set_validation_behavior(&mut self, behavior: ValidationBehavior)
pub fn set_validation_behavior(&mut self, behavior: ValidationBehavior)
Set by the component’s validation_behavior builder.
Sourcepub fn routed_errors(&self) -> &[SharedString]
pub fn routed_errors(&self) -> &[SharedString]
The server messages the form routed to this field, as last written by
the form’s validationErrors delivery — what this field’s error slot
renders, and what a native submit consults beside the stored
validity. Empty once the user edited the field or a reset hid them.
Sourcepub fn set_value(&mut self, value: impl Into<String>)
pub fn set_value(&mut self, value: impl Into<String>)
Replaces the value, clears any selection and composition, and moves the cursor to the end.
Sourcepub fn clear_focus_handle(&self) -> FocusHandle
pub fn clear_focus_handle(&self) -> FocusHandle
The clear affordance’s focus handle. It is not a tab stop.
Trait Implementations§
Source§impl Focusable for InputState
impl Focusable for InputState
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Auto Trait Implementations§
impl !RefUnwindSafe for InputState
impl !UnwindSafe for InputState
impl Freeze for InputState
impl Send for InputState
impl Sync for InputState
impl Unpin for InputState
impl UnsafeUnpin for InputState
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more