Exempt from the catalog
the hidden input behind a widget's value; seen through the widgets that draw it (combo boxes, calendars, colors)
Docs
Renders a visually-hidden input that backs a widget-managed form field
(combo box, calendar, color picker, ProseMirror editor, and similar
custom inputs where the user interacts with a JS widget while the actual
form value lives in a backing input).
Emitted as `<input type="text" hidden>` — *not* `type="hidden"` — so that
Phoenix LiveView's `used_input?/1` tracking works correctly. LiveView's JS
[explicitly skips emitting `_unused_<name>` markers for `input.type ===
"hidden"` elements](https://github.com/phoenixframework/phoenix_live_view/blob/main/assets/js/phoenix_live_view/view.js#L144),
which means any validation error attached to a `type="hidden"` field
renders on the first `phx-change`, before the user has had a chance to
interact with the widget.
Use `hidden/1` for truly non-interactive form fields (pre-populated IDs,
checkbox `false` sentinels, etc.) and `managed_input/1` for anything the
user can edit via a custom JS widget. The hosting widget is expected to
update `field.value` and dispatch an `input` event when the user
interacts — that's what Phoenix uses to flip the field from "unused" to
"used".
## Example
<ConnieUI.Forms.managed_input field={@field} />
| Attribute | Type | Default | Description |
|---|---|---|---|
| No data found. | |||
| field * | {:struct, Phoenix.HTML.FormField} |
|
|
| rest | :global |
|
|