pub struct InputConfig {Show 28 fields
pub style: ResolvedTextStyle,
pub align: TextAlign,
pub placeholder: String,
pub placeholder_color: Option<Color>,
pub secure: bool,
pub keyboard: KeyboardType,
pub keyboard_appearance: KeyboardAppearance,
pub return_key: ReturnKeyType,
pub auto_capitalize: AutoCapitalize,
pub auto_correct: bool,
pub multiline: bool,
pub max_length: Option<u32>,
pub editable: bool,
pub blur_on_submit: bool,
pub submit_behavior: Option<SubmitBehavior>,
pub paste_behavior: PasteBehavior,
pub paste_max_size: Option<u64>,
pub auto_focus: bool,
pub select_text_on_focus: bool,
pub selection_color: Option<Color>,
pub caret_color: Option<Color>,
pub auto_fill: AutoFill,
pub rtl: bool,
pub caret_hidden: bool,
pub accessory_id: Option<Box<str>>,
pub accessory: Option<NodeId>,
pub scrollbar_visible: bool,
pub report_scroll: bool,
}Expand description
Everything about a text input except its text.
Fields§
§style: ResolvedTextStyleFont and color of the text.
align: TextAlignAlignment of the text.
placeholder: StringShown while the text is empty.
placeholder_color: Option<Color>Placeholder color; the platform’s default when None.
secure: boolHide the characters (passwords).
keyboard: KeyboardTypeKeyboard layout.
keyboard_appearance: KeyboardAppearanceThe keyboard’s look (iOS).
return_key: ReturnKeyTypeLabel of the return key.
auto_capitalize: AutoCapitalizeAutomatic capitalization.
auto_correct: boolThe system’s corrections: spelling, smart quotes and dashes, text replacement.
multiline: boolSeveral lines (return inserts a line break).
max_length: Option<u32>The most characters the user’s edits leave (maxLength), counted
as Unicode scalar values (crate::text_edit::char_len); an
insertion is cut by crate::text_edit::clip_chars.
editable: boolThe user can edit the text.
blur_on_submit: boolReturn unfocuses a single-line input without a submitBehavior
(always true from TS); InputConfig::submit resolves it.
submit_behavior: Option<SubmitBehavior>submitBehavior as set; InputConfig::submit resolves it.
paste_behavior: PasteBehaviorWhat a paste does (pasteBehavior).
paste_max_size: Option<u64>The largest pasted file read, in bytes (pasteMaxSize): a larger
one goes to crate::PasteEvent::too_large unread. None: all.
auto_focus: boolFocus once on screen.
select_text_on_focus: boolSelect the whole text when the input takes the focus
(selectTextOnFocus).
selection_color: Option<Color>Selection highlight color (on iOS also the caret’s, unless
InputConfig::caret_color is set: UIKit tints both with one).
caret_color: Option<Color>Caret color; the platform’s default when None.
auto_fill: AutoFillWhat the input holds, for autofill.
rtl: boolThe text runs right to left.
No caret is drawn (caret={false}).
accessory_id: Option<Box<str>>inputAccessoryViewID as set.
accessory: Option<NodeId>The input accessory it names, if one is mounted.
scrollbar_visible: boolA multiline input shows its scroll indicator (scrollbar; false
while a built-in bar takes its place).
report_scroll: boolA bar of the app’s follows a multiline input’s text (its built-in
bar, or one the app placed that watches it, watch_scroll): the
platform reports how far the text scrolled
(EngineControl::input_scroll). Off, it reports nothing.
Implementations§
Source§impl InputConfig
impl InputConfig
Sourcepub fn submit(&self) -> SubmitBehavior
pub fn submit(&self) -> SubmitBehavior
What return does, as submitBehavior and multiline say
together: the set behavior (a single line never takes line breaks),
else a line break in a multiline input, else a submit that
unfocuses unless InputConfig::blur_on_submit is false (Rust).
Sourcepub fn visible_password(&self) -> bool
pub fn visible_password(&self) -> bool
A password shown as plain text: the input holds a password
(InputConfig::auto_fill current-password or new-password)
but is not secure, as after a “show password” toggle. Platforms
type it as it is: Android’s visible password keyboard, iOS’s ASCII
keyboard, never capitalized, suggested or corrected.