pub struct TextInput { /* private fields */ }Expand description
A single-line text input with cursor
Handles typing, backspace, delete, and cursor movement. Emits on_change for each keystroke, on_submit for Enter, and on_cursor_move for cursor-only movement if provided.
Implementations§
Source§impl TextInput
impl TextInput
Sourcepub fn render_widget(
&mut self,
frame: &mut Frame<'_>,
area: Rect,
props: TextInputRenderProps<'_>,
)
pub fn render_widget( &mut self, frame: &mut Frame<'_>, area: Rect, props: TextInputRenderProps<'_>, )
Render the widget without requiring update callbacks.
Trait Implementations§
Source§impl<A> Component<A> for TextInput
impl<A> Component<A> for TextInput
Source§type Props<'a> = TextInputProps<'a, A>
type Props<'a> = TextInputProps<'a, A>
Data required to render the component (read-only)
Source§fn handle_event(
&mut self,
event: &EventKind,
props: Self::Props<'_>,
) -> impl IntoIterator<Item = A>
fn handle_event( &mut self, event: &EventKind, props: Self::Props<'_>, ) -> impl IntoIterator<Item = A>
Handle an event and return actions to dispatch Read more
Source§impl ComponentDebugState for TextInput
impl ComponentDebugState for TextInput
fn debug_state(&self) -> Vec<ComponentDebugEntry>
Source§impl<A, Ctx> InteractiveComponent<A, Ctx> for TextInput
impl<A, Ctx> InteractiveComponent<A, Ctx> for TextInput
type Props<'a> = TextInputProps<'a, A>
fn update( &mut self, input: ComponentInput<'_, Ctx>, props: Self::Props<'_>, ) -> HandlerResponse<A>
fn render(&mut self, frame: &mut Frame<'_>, area: Rect, props: Self::Props<'_>)
Source§fn subscriptions() -> &'static [EventType]
fn subscriptions() -> &'static [EventType]
Event types this component should receive when bound through
ComponentHost. Read moreAuto Trait Implementations§
impl Freeze for TextInput
impl RefUnwindSafe for TextInput
impl Send for TextInput
impl Sync for TextInput
impl Unpin for TextInput
impl UnsafeUnpin for TextInput
impl UnwindSafe for TextInput
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<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>
Converts
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>
Converts
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