Phoenix LiveView Hooks: window scroll issues

Sure.

The element is:

      <%= if @changeset.action do %>
        <div
          id="complaint-form-errors"
          class="alert alert-danger"
          phx-hook="formScrollToError">There was a problem saving this complaint!</div>
      <% end %>

And the formScrollToError hook is:

export const formScrollToError = {
  mounted () {
    window.scrollTo(0, 0);
  }
} as Hook;