Skip to main content

field

Function field 

Source
pub fn field<'a>(id: impl Into<WidgetId>, rect: Rect) -> FieldBuilder<'a>
Expand description

A text field whose box the app paints itself (a search pill, a dialog row, a sign-in input): the kit registers it at rect, names it, draws text, placeholder, selection, a blinking caret and composition, and feeds caret geometry and the IME area back to the text store. The edit state lives in the store; seed or clear it there before build.

Like an <input>, the text is clipped to its rect and scrolls sideways with the caret while focused (back to the start when not). A field inside a scrolling box (a dialog body) gets that box with FieldBuilder::clip_to: what scrolls out of it is neither painted nor hit.