# `Soundcheck.Check.Warning.FormWithoutRecovery`
[🔗](https://github.com/leonqadirie/soundcheck/blob/v0.1.0/lib/soundcheck/check/warning/form_without_recovery.ex#L1)

## Basics

> #### This check is disabled by default. {: .neutral}
>
> [Learn how to enable it](`e:credo:config_file.html#checks`) via `.credo.exs`.

This check has a base priority of `normal` and works with any version of Elixir.

## Explanation

Flags `phx-submit` forms that LiveView cannot recover after a
reconnect. When the socket drops (a deploy, a flaky network) and
reconnects, LiveView restores a form's input by sending its values
to the form's `phx-change` event, and it finds the form by `id`. A
form without an `id`, or without `phx-change`, loses everything the
user typed.

Before:

    <.form for={@form} phx-submit="save">
      <.input field={@form[:title]} />
    </.form>

After:

    <.form for={@form} id="post-form" phx-change="validate" phx-submit="save">
      <.input field={@form[:title]} />
    </.form>

`phx-auto-recover` names another event for recovery and counts in
place of `phx-change`; `phx-auto-recover="ignore"` opts a form out of
recovery and silences the check. Forms with a dynamic attribute list
(`<.form {@rest}>`) are skipped, because the list may carry both.

Confidence: medium. Tier: syntactic (works without compiling).

## Check-Specific Parameters

Use the following parameters to configure this check:

### `:excluded_paths`

  Paths to skip (atoms, binaries as path segments, or regexes).

*This parameter defaults to* `[~r/\/test\//, "test"]`.

### `:strict`

  Unused.

*This parameter defaults to* `false`.

## General Parameters

Like with all checks, [general params](`e:credo:check_params.html`) can be applied.

Parameters can be configured via the [`.credo.exs` config file](`e:credo:config_file.html`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
