pub struct Filling<'a> {
pub value: Value<'a>,
pub trailing: Option<Markup<'a>>,
pub control_attrs: Option<Markup<'a>>,
pub id_prefix: Option<&'a str>,
}Expand description
Everything about the field that the description does not carry.
Fields§
§value: Value<'a>What the field holds now.
trailing: Option<Markup<'a>>Markup appended inside the group, after the hint. Not escaped.
control_attrs: Option<Markup<'a>>Attributes written onto the control element itself. Not escaped.
trailing’s argument at attribute scale: a host knows
facts about the control that no description layer carries, and until
this existed the only way to attach one was to stop calling this emitter
and write a second one. quasi’s suggestion source is the first caller —
a field that owns a list of candidates is a role="combobox" pointing
at the list it owns, and neither half is anything
makeover_layout::Field can say.
Written verbatim, so a caller supplies attr="value" pairs with no
leading space and does its own escaping. It is Markup’s hole in the
same wall, named the same way so a caller has to state that the contents
are trusted.
A FieldKind::Radio drops them, and that is deliberate rather than an
oversight: a radio group is a set of sibling inputs with no one control
element, so there is nowhere honest to put an attribute meant for the
control. The group carries the descriptions for the same reason.
id_prefix: Option<&'a str>Scopes the id attributes to one instance of the form.
The field’s name is what the value submits under and is the same
wherever the form appears; its id has to be unique in the document,
and those two facts stop agreeing the moment a form appears twice.
goingson hits this directly: its new-task and edit-task modals are the
same field set, so it prefixes form-modal-task-new or -edit to keep
label for and aria-describedby pointing at the right control.
Applies to id, for and the -hint / -error associations. Never to
name, which would change what the form submits.