Skip to content

Don't use RHF validation mode: 'all' #1761

Closed

Description

@david-crespo

I did this in #1254, and I thought I had a comment in the PR about why, but I don't see one. mode: 'all' means that we will validate an input on every keypress as you type. It took me about 1 minute of using the console on a real rack to know this is awful. You're typing your instance name my-instance, but as soon as you hit the dash, the thing is blowing up in your face for no reason.

image

We could get elaborate and try to validate on change but with some debouncing to avoid this particular annoyance, but I don't see why we'd bother. onBlur or onTouched are probably better.

https://react-hook-form.com/docs/useform#mode

image

Activity

  1. benjaminleonard commented on Oct 4, 2023

    @benjaminleonard
    Contributor

    Would fix #1289

  2. self-assigned this
    on Oct 4, 2023
  3. added this to the 3 milestone on Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions