Expand description
A single-line editable text control.
TextInput is a view rather than a RenderOnce builder, because editing
carries state that outlives a frame: the caret, the selection, the
in-progress input method composition, and the horizontal scroll position.
Callers own the entity and read TextInput::value from it.
let input = cx.new(|cx| {
TextInput::new("settings.token", window, cx)
.placeholder("sk-...")
.secret(true)
});
cx.subscribe(&input, |_host, input, event, cx| {
if let TextInputEvent::Submit = event {
let _typed = input.read(cx).value().to_string();
}
})
.detach();Structs§
- Backspace
- Cancel
- Copy
- Cut
- Delete
- Delete
ToLine Start - Delete
Word Left - Delete
Word Right - Left
- LineEnd
- Line
Start - Paste
- Right
- Select
All - Select
Left - Select
Right - Select
ToLine End - Select
ToLine Start - Select
Word Left - Select
Word Right - Show
Character Palette - Submit
- Text
Input - One line of editable text.
- Word
Left - Word
Right
Enums§
- Text
Input Event - What an input reports to its owner.
Constants§
- KEY_
CONTEXT - The key context every input publishes, so a host can layer its own bindings on top without re-declaring these.