Skip to main content

TextInput

Trait TextInput 

Source
pub trait TextInput {
    // Required methods
    fn text(&self) -> Fragment<'_>;
    fn move_cursor_to_front(&mut self);
    fn move_cursor_to_end(&mut self);
    fn move_cursor_to(&mut self, location: Position);
    fn select_all(&mut self);
    fn select_range(&mut self, start: Position, end: Position);
}
Expand description

The internal state of a widget that has text input.

Required Methods§

Source

fn text(&self) -> Fragment<'_>

Returns the current visible text of the text input.

Normally, this is either its value or its placeholder.

Source

fn move_cursor_to_front(&mut self)

Moves the cursor of the text input to the front of the input text.

Source

fn move_cursor_to_end(&mut self)

Moves the cursor of the text input to the end of the input text.

Source

fn move_cursor_to(&mut self, location: Position)

Moves the cursor of the text input to an arbitrary location.

Source

fn select_all(&mut self)

Selects all the content of the text input.

Source

fn select_range(&mut self, start: Position, end: Position)

Selects the given content range of the text input.

Implementors§