Skip to main content

textfield_axis

Function textfield_axis 

Source
pub fn textfield_axis(
    placeholder: &str,
    state: &BoundState<String>,
    axis: Axis,
) -> View
Expand description

TextField(_:text:axis:) — a field that grows along axis as it is typed into.

Axis::Vertical is the multi-line one: it starts a line high and adds rows as the text wraps, which is what a comment box or a note is. Only the deprecated onEditingChanged:onCommit: initialiser was bound, so every field was one line whatever went in it.

let note = BoundState::new(String::new());
let field = textfield_axis("Note", &note, Axis::Vertical);