Expand description
A multi-line editable text control.
TextArea is a view rather than a RenderOnce builder, for the same
reason crate::controls::input::TextInput is: the caret, the selection,
the in-progress input method composition, and the vertical scroll position
all outlive a frame. Text wraps at the width the control was given, so
there is no horizontal scrolling, and the caret moves by visual line.
let notes = cx.new(|cx| {
TextArea::new("review.notes", window, cx)
.placeholder("What changed, and why")
.rows(4)
.max_rows(12)
});
cx.subscribe(¬es, |_host, notes, event, cx| {
if let TextAreaEvent::Submit = event {
let _typed = notes.read(cx).value().to_string();
}
})
.detach();Structs§
- Backspace
- Cancel
- Copy
- Cut
- Delete
- Delete
ToLine Start - Delete
Word Left - Delete
Word Right - Document
End - Document
Start - Down
- Left
- LineEnd
- Line
Start - Newline
- Paste
- Right
- Select
All - Select
Down - Select
Left - Select
Right - Select
ToDocument End - Select
ToDocument Start - Select
ToLine End - Select
ToLine Start - Select
Up - Select
Word Left - Select
Word Right - Show
Character Palette - Submit
- Text
Area - Wrapped, multi-line editable text.
- Up
- Word
Left - Word
Right
Enums§
- Text
Area Event - What a text area reports to its owner.
Constants§
- KEY_
CONTEXT - The key context every text area publishes, so a host can layer its own bindings on top without re-declaring these.